fix(spanish-md): Address some formatting issues for Spanish md
This commit is contained in:
committed by
mrugesh mohapatra
parent
ee9f6b2d72
commit
c2a45b58be
@ -25,7 +25,7 @@ Camper Cat es tanto un ninja codificador como un ninja real, y está construyend
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Su etiqueta <code>img</code> debe tener un atributo <code>alt</code> , y no debe estar vacío'.
|
- text: 'Su etiqueta <code>img</code> debe tener un atributo <code>alt</code> , y no debe estar vacío'
|
||||||
testString: 'assert($("img").attr("alt"), "Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.");'
|
testString: 'assert($("img").attr("alt"), "Your <code>img</code> tag should have an <code>alt</code> attribute, and it should not be empty.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ encuentran los resultados de la encuesta de Mortal Kombat de Camper Cat! Envuelv
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Sus etiquetas de <code>time</code> deben rodear el texto "Jueves 15 de septiembre <sup> th </sup>".'
|
- text: 'Sus etiquetas de <code>time</code> deben rodear el texto "Jueves 15 de septiembre <sup> th </sup>".'
|
||||||
testString: 'assert($("time").text().match(/Thursday, September 15th/g), "Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".");'
|
testString: 'assert($("time").text().match(/Thursday, September 15th/g), "Your <code>time</code> tags should wrap around the text "Thursday, September 15<sup>th</sup>".");'
|
||||||
- text: Su etiqueta de <code>time</code> debe tener un atributo de <code>datetime</code> y <code>datetime</code> que no esté vacío.
|
- text: Su etiqueta de <code>time</code> debe tener un atributo de <code>datetime</code> y <code>datetime</code> que no esté vacío.
|
||||||
testString: 'assert($("time").attr("datetime"), "Your <code>time</code> tag should have a <code>datetime</code> attribute that is not empty.");'
|
testString: 'assert($("time").attr("datetime"), "Your <code>time</code> tag should have a <code>datetime</code> attribute that is not empty.");'
|
||||||
|
@ -25,7 +25,7 @@ También para el <code>h4</code> , elimine la propiedad de <code>height</code> y
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Su código debe agregar una propiedad de <code>background-color</code> al conjunto de elementos <code>h4</code> en <code>rgba(45, 45, 45, 0.1)</code> .'
|
- text: 'Su código debe agregar una propiedad de <code>background-color</code> al conjunto de elementos <code>h4</code> en <code>rgba(45, 45, 45, 0.1)</code> .'
|
||||||
testString: 'assert(code.match(/background-color:\s*?rgba\(\s*?45\s*?,\s*?45\s*?,\s*?45\s*?,\s*?0?\.1\s*?\)/gi), "Your code should add a <code>background-color</code> property to the <code>h4</code> element set to <code>rgba(45, 45, 45, 0.1)</code>.");'
|
testString: 'assert(code.match(/background-color:\s*?rgba\(\s*?45\s*?,\s*?45\s*?,\s*?45\s*?,\s*?0?\.1\s*?\)/gi), "Your code should add a <code>background-color</code> property to the <code>h4</code> element set to <code>rgba(45, 45, 45, 0.1)</code>.");'
|
||||||
- text: Su código debe agregar una propiedad de <code>padding</code> al elemento <code>h4</code> y establecerlo en 10 píxeles.
|
- text: Su código debe agregar una propiedad de <code>padding</code> al elemento <code>h4</code> y establecerlo en 10 píxeles.
|
||||||
testString: 'assert($("h4").css("padding-top") == "10px" && $("h4").css("padding-right") == "10px" && $("h4").css("padding-bottom") == "10px" && $("h4").css("padding-left") == "10px", "Your code should add a <code>padding</code> property to the <code>h4</code> element and set it to 10 pixels.");'
|
testString: 'assert($("h4").css("padding-top") == "10px" && $("h4").css("padding-right") == "10px" && $("h4").css("padding-bottom") == "10px" && $("h4").css("padding-left") == "10px", "Your code should add a <code>padding</code> property to the <code>h4</code> element and set it to 10 pixels.");'
|
||||||
|
@ -21,13 +21,13 @@ Esta página utilizará un tono de verde azulado ( <code>#09A7A1</code> ) como c
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento del <code>header</code> debe tener un <code>background-color</code> de <code>background-color</code> de # 09A7A1.'
|
- text: 'El elemento del <code>header</code> debe tener un <code>background-color</code> de <code>background-color</code> de # 09A7A1.'
|
||||||
testString: 'assert($("header").css("background-color") == "rgb(9, 167, 161)", "The <code>header</code> element should have a <code>background-color</code> of #09A7A1.");'
|
testString: 'assert($("header").css("background-color") == "rgb(9, 167, 161)", "The <code>header</code> element should have a <code>background-color</code> of #09A7A1.");'
|
||||||
- text: 'El elemento de <code>footer</code> debe tener un <code>background-color</code> de <code>background-color</code> de # 09A7A1.'
|
- text: 'El elemento de <code>footer</code> debe tener un <code>background-color</code> de <code>background-color</code> de # 09A7A1.'
|
||||||
testString: 'assert($("footer").css("background-color") == "rgb(9, 167, 161)", "The <code>footer</code> element should have a <code>background-color</code> of #09A7A1.");'
|
testString: 'assert($("footer").css("background-color") == "rgb(9, 167, 161)", "The <code>footer</code> element should have a <code>background-color</code> of #09A7A1.");'
|
||||||
- text: 'El elemento <code>h2</code> debe tener un <code>color</code> de # 09A7A1.'
|
- text: 'El elemento <code>h2</code> debe tener un <code>color</code> de # 09A7A1.'
|
||||||
testString: 'assert($("h2").css("color") == "rgb(9, 167, 161)", "The <code>h2</code> element should have a <code>color</code> of #09A7A1.");'
|
testString: 'assert($("h2").css("color") == "rgb(9, 167, 161)", "The <code>h2</code> element should have a <code>color</code> of #09A7A1.");'
|
||||||
- text: 'El elemento del <code>button</code> debe tener un <code>background-color</code> de <code>background-color</code> de # FF790E.'
|
- text: 'El elemento del <code>button</code> debe tener un <code>background-color</code> de <code>background-color</code> de # FF790E.'
|
||||||
testString: 'assert($("button").css("background-color") == "rgb(255, 121, 14)", "The <code>button</code> element should have a <code>background-color</code> of #FF790E.");'
|
testString: 'assert($("button").css("background-color") == "rgb(255, 121, 14)", "The <code>button</code> element should have a <code>background-color</code> of #FF790E.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ El editor de código tiene una regla CSS para el estilo de todo <code>a</code> n
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El <code>color</code> etiqueta de anclaje debe permanecer en negro, solo agregue reglas CSS para el <code>:hover</code> estado de <code>:hover</code> '.
|
- text: 'El <code>color</code> etiqueta de anclaje debe permanecer en negro, solo agregue reglas CSS para el <code>:hover</code> estado de <code>:hover</code> '
|
||||||
testString: 'assert($("a").css("color") == "rgb(0, 0, 0)", "The anchor tag <code>color</code> should remain black, only add CSS rules for the <code>:hover</code> state.");'
|
testString: 'assert($("a").css("color") == "rgb(0, 0, 0)", "The anchor tag <code>color</code> should remain black, only add CSS rules for the <code>:hover</code> state.");'
|
||||||
- text: La etiqueta de anclaje debe tener un <code>color</code> azul en el hover.
|
- text: La etiqueta de anclaje debe tener un <code>color</code> azul en el hover.
|
||||||
testString: 'assert(code.match(/a:hover\s*?{\s*?color:\s*?blue;\s*?}/gi), "The anchor tag should have a <code>color</code> of blue on hover.");'
|
testString: 'assert(code.match(/a:hover\s*?{\s*?color:\s*?blue;\s*?}/gi), "The anchor tag should have a <code>color</code> of blue on hover.");'
|
||||||
|
@ -28,7 +28,7 @@ tests:
|
|||||||
testString: 'assert(code.match(/background-color:\s*?transparent;/gi), "The value of the <code>background-color</code> property should be set to <code>transparent</code>.");'
|
testString: 'assert(code.match(/background-color:\s*?transparent;/gi), "The value of the <code>background-color</code> property should be set to <code>transparent</code>.");'
|
||||||
- text: El valor de la propiedad <code>border-radius</code> debe establecer en <code>50%</code> .
|
- text: El valor de la propiedad <code>border-radius</code> debe establecer en <code>50%</code> .
|
||||||
testString: 'assert(code.match(/border-radius:\s*?50%;/gi), "The value of the <code>border-radius</code> property should be set to <code>50%</code>.");'
|
testString: 'assert(code.match(/border-radius:\s*?50%;/gi), "The value of the <code>border-radius</code> property should be set to <code>50%</code>.");'
|
||||||
- text: 'El valor de la propiedad <code>box-shadow</code> debe establecerse en 25px para <code>offset-x</code> , 10px para <code>offset-y</code> , 0 para <code>blur-radius</code> de <code>blur-radius</code> , 0 para <code>spread-radius</code> de <code>spread-radius</code> y finalmente azul para el color.'
|
- text: 'El valor de la propiedad <code>box-shadow</code> debe establecerse en 25px para <code>offset-x</code> , 10px para <code>offset-y</code> , 0 para <code>blur-radius</code> de <code>blur-radius</code> , 0 para <code>spread-radius</code> de <code>spread-radius</code> y finalmente azul para el color.'
|
||||||
testString: 'assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi), "The value of the <code>box-shadow</code> property should be set to 25px for <code>offset-x</code>, 10px for <code>offset-y</code>, 0 for <code>blur-radius</code>, 0 for <code>spread-radius</code>, and finally blue for the color.");'
|
testString: 'assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi), "The value of the <code>box-shadow</code> property should be set to 25px for <code>offset-x</code>, 10px for <code>offset-y</code>, 0 for <code>blur-radius</code>, 0 for <code>spread-radius</code>, and finally blue for the color.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,13 +26,13 @@ Finalmente, en el <code>heart::before</code> selector, establece su propiedad de
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'La propiedad de <code>background-color</code> de fondo del <code>heart::after</code> selector debe ser rosa.'
|
- text: 'La propiedad de <code>background-color</code> de fondo del <code>heart::after</code> selector debe ser rosa.'
|
||||||
testString: 'assert(code.match(/\.heart::after\s*?{\s*?background-color\s*?:\s*?pink\s*?;/gi), "The <code>background-color</code> property of the <code>heart::after</code> selector should be pink.");'
|
testString: 'assert(code.match(/\.heart::after\s*?{\s*?background-color\s*?:\s*?pink\s*?;/gi), "The <code>background-color</code> property of the <code>heart::after</code> selector should be pink.");'
|
||||||
- text: 'El <code>border-radius</code> del <code>border-radius</code> del <code>heart::after</code> selector debe ser del 50%.'
|
- text: 'El <code>border-radius</code> del <code>border-radius</code> del <code>heart::after</code> selector debe ser del 50%.'
|
||||||
testString: 'assert(code.match(/border-radius\s*?:\s*?50%/gi).length == 2, "The <code>border-radius</code> of the <code>heart::after</code> selector should be 50%.");'
|
testString: 'assert(code.match(/border-radius\s*?:\s*?50%/gi).length == 2, "The <code>border-radius</code> of the <code>heart::after</code> selector should be 50%.");'
|
||||||
- text: La propiedad de <code>transform</code> para la clase de <code>heart</code> debe usar una función <code>rotate()</code> establecida en -45 grados.
|
- text: La propiedad de <code>transform</code> para la clase de <code>heart</code> debe usar una función <code>rotate()</code> establecida en -45 grados.
|
||||||
testString: 'assert(code.match(/transform\s*?:\s*?rotate\(\s*?-45deg\s*?\)/gi), "The <code>transform</code> property for the <code>heart</code> class should use a <code>rotate()</code> function set to -45 degrees.");'
|
testString: 'assert(code.match(/transform\s*?:\s*?rotate\(\s*?-45deg\s*?\)/gi), "The <code>transform</code> property for the <code>heart</code> class should use a <code>rotate()</code> function set to -45 degrees.");'
|
||||||
- text: 'El <code>content</code> del <code>heart::before</code> selector debe ser una cadena vacía.'
|
- text: 'El <code>content</code> del <code>heart::before</code> selector debe ser una cadena vacía.'
|
||||||
testString: 'assert(code.match(/\.heart::before\s*?{\s*?content\s*?:\s*?("|")\1\s*?;/gi), "The <code>content</code> of the <code>heart::before</code> selector should be an empty string.");'
|
testString: 'assert(code.match(/\.heart::before\s*?{\s*?content\s*?:\s*?("|")\1\s*?;/gi), "The <code>content</code> of the <code>heart::before</code> selector should be an empty string.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,11 +22,11 @@ Bloquee el elemento <code>#searchbar</code> en la parte superior derecha de su <
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#searchbar</code> debería tener una <code>position</code> establecida en <code>absolute</code> .'
|
- text: 'El elemento <code>#searchbar</code> debería tener una <code>position</code> establecida en <code>absolute</code> .'
|
||||||
testString: 'assert($("#searchbar").css("position") == "absolute", "The <code>#searchbar</code> element should have a <code>position</code> set to <code>absolute</code>.");'
|
testString: 'assert($("#searchbar").css("position") == "absolute", "The <code>#searchbar</code> element should have a <code>position</code> set to <code>absolute</code>.");'
|
||||||
- text: 'Su código debe usar el desplazamiento de CSS <code>top</code> de 50 píxeles en el elemento <code>#searchbar</code> '.
|
- text: 'Su código debe usar el desplazamiento de CSS <code>top</code> de 50 píxeles en el elemento <code>#searchbar</code> '
|
||||||
testString: 'assert($("#searchbar").css("top") == "50px", "Your code should use the <code>top</code> CSS offset of 50 pixels on the <code>#searchbar</code> element.");'
|
testString: 'assert($("#searchbar").css("top") == "50px", "Your code should use the <code>top</code> CSS offset of 50 pixels on the <code>#searchbar</code> element.");'
|
||||||
- text: 'Su código debe usar el desplazamiento de CSS <code>right</code> de 50 píxeles en el elemento <code>#searchbar</code> '.
|
- text: 'Su código debe usar el desplazamiento de CSS <code>right</code> de 50 píxeles en el elemento <code>#searchbar</code> '
|
||||||
testString: 'assert($("#searchbar").css("right") == "50px", "Your code should use the <code>right</code> CSS offset of 50 pixels on the <code>#searchbar</code> element.");'
|
testString: 'assert($("#searchbar").css("right") == "50px", "Your code should use the <code>right</code> CSS offset of 50 pixels on the <code>#searchbar</code> element.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,11 +22,11 @@ La barra de navegación en el código está etiquetada con un ID de <code>navbar
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#navbar</code> debería tener una <code>position</code> establecida como <code>fixed</code> .'
|
- text: 'El elemento <code>#navbar</code> debería tener una <code>position</code> establecida como <code>fixed</code> .'
|
||||||
testString: 'assert($("#navbar").css("position") == "fixed", "The <code>#navbar</code> element should have a <code>position</code> set to <code>fixed</code>.");'
|
testString: 'assert($("#navbar").css("position") == "fixed", "The <code>#navbar</code> element should have a <code>position</code> set to <code>fixed</code>.");'
|
||||||
- text: 'Su código debe usar el desplazamiento de CSS <code>top</code> de 0 píxeles en el elemento <code>#navbar</code> '.
|
- text: 'Su código debe usar el desplazamiento de CSS <code>top</code> de 0 píxeles en el elemento <code>#navbar</code> '
|
||||||
testString: 'assert($("#navbar").css("top") == "0px", "Your code should use the <code>top</code> CSS offset of 0 pixels on the <code>#navbar</code> element.");'
|
testString: 'assert($("#navbar").css("top") == "0px", "Your code should use the <code>top</code> CSS offset of 0 pixels on the <code>#navbar</code> element.");'
|
||||||
- text: 'Tu código debe usar el desplazamiento de CSS <code>left</code> de 0 píxeles en el elemento <code>#navbar</code> '.
|
- text: 'Tu código debe usar el desplazamiento de CSS <code>left</code> de 0 píxeles en el elemento <code>#navbar</code> '
|
||||||
testString: 'assert($("#navbar").css("left") == "0px", "Your code should use the <code>left</code> CSS offset of 0 pixels on the <code>#navbar</code> element.");'
|
testString: 'assert($("#navbar").css("left") == "0px", "Your code should use the <code>left</code> CSS offset of 0 pixels on the <code>#navbar</code> element.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -25,7 +25,7 @@ Cambie el valor de la <code>animation-timing-function</code> de <code>animation-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El valor de la propiedad <code>animation-timing-function</code> para el elemento con el id <code>green</code> debe ser una función de <code>cubic-bezier</code> con los valores de x1, y1, x2, y2 según lo especificado.'
|
- text: 'El valor de la propiedad <code>animation-timing-function</code> para el elemento con el id <code>green</code> debe ser una función de <code>cubic-bezier</code> con los valores de x1, y1, x2, y2 según lo especificado.'
|
||||||
testString: 'assert($("#green").css("animation-timing-function") == "cubic-bezier(0.311, 0.441, 0.444, 1.649)", "The value of the <code>animation-timing-function</code> property for the element with the id <code>green</code> should be a <code>cubic-bezier</code> function with x1, y1, x2, y2 values as specified.'
|
testString: 'assert($("#green").css("animation-timing-function") == "cubic-bezier(0.311, 0.441, 0.444, 1.649)", "The value of the <code>animation-timing-function</code> property for the element with the id <code>green</code> should be a <code>cubic-bezier</code> function with x1, y1, x2, y2 values as specified.'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ Establezca la propiedad de <code>animation-fill-mode</code> del <code>button:hov
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>button:hover</code> debería tener una propiedad de <code>animation-fill-mode</code> con un valor de <code>forwards</code> .'
|
- text: ' <code>button:hover</code> debería tener una propiedad de <code>animation-fill-mode</code> con un valor de <code>forwards</code> .'
|
||||||
testString: 'assert(code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-fill-mode\s*?:\s*?forwards\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-name\s*?:\s*?background-color\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-duration\s*?:\s*?500ms\s*?;[\s\S]*}/gi), "<code>button:hover</code> should have a <code>animation-fill-mode</code> property with a value of <code>forwards</code>.");'
|
testString: 'assert(code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-fill-mode\s*?:\s*?forwards\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-name\s*?:\s*?background-color\s*?;[\s\S]*}/gi) && code.match(/button\s*?:\s*?hover\s*?{[\s\S]*animation-duration\s*?:\s*?500ms\s*?;[\s\S]*}/gi), "<code>button:hover</code> should have a <code>animation-fill-mode</code> property with a value of <code>forwards</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -20,9 +20,9 @@ Use las compensaciones de CSS para mover el <code>h2</code> 15 píxeles a la der
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Su código debe usar un desplazamiento de CSS para posicionar relativamente el <code>h2</code> 10px hacia arriba. En otras palabras, aléjelo 10px de la <code>bottom</code> de donde normalmente se sienta. '
|
- text: 'Su código debe usar un desplazamiento de CSS para posicionar relativamente el <code>h2</code> 10px hacia arriba. En otras palabras, aléjelo 10px de la <code>bottom</code> de donde normalmente se sienta. '
|
||||||
testString: 'assert($("h2").css("bottom") == "10px", "Your code should use a CSS offset to relatively position the <code>h2</code> 10px upwards. In other words, move it 10px away from the <code>bottom</code> of where it normally sits.");'
|
testString: 'assert($("h2").css("bottom") == "10px", "Your code should use a CSS offset to relatively position the <code>h2</code> 10px upwards. In other words, move it 10px away from the <code>bottom</code> of where it normally sits.");'
|
||||||
- text: 'Su código debe usar un desplazamiento de CSS para posicionar relativamente el <code>h2</code> 15px hacia la derecha. En otras palabras, aléjelo a 15px de la <code>left</code> de donde normalmente se encuentra.
|
- text: 'Su código debe usar un desplazamiento de CSS para posicionar relativamente el <code>h2</code> 15px hacia la derecha. En otras palabras, aléjelo a 15px de la <code>left</code> de donde normalmente se encuentra.
|
||||||
testString: 'assert($("h2").css("left") == "15px", "Your code should use a CSS offset to relatively position the <code>h2</code> 15px towards the right. In other words, move it 15px away from the <code>left</code> of where it normally sits.");'
|
testString: 'assert($("h2").css("left") == "15px", "Your code should use a CSS offset to relatively position the <code>h2</code> 15px towards the right. In other words, move it 15px away from the <code>left</code> of where it normally sits.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ Para ver el efecto de esta curva de Bezier en acción, cambie la <code>animation
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El valor de la propiedad <code>animation-timing-function</code> del elemento con el id <code>red</code> debe ser una función de <code>cubic-bezier</code> con x1, y1, x2, y2 valores establecidos respectivamente en 0, 0, 0.58, 1.'
|
- text: 'El valor de la propiedad <code>animation-timing-function</code> del elemento con el id <code>red</code> debe ser una función de <code>cubic-bezier</code> con x1, y1, x2, y2 valores establecidos respectivamente en 0, 0, 0.58, 1.'
|
||||||
testString: 'assert($("#red").css("animation-timing-function") == "cubic-bezier(0, 0, 0.58, 1)", "The value of the <code>animation-timing-function</code> property of the element with the id <code>red</code> should be a <code>cubic-bezier</code> function with x1, y1, x2, y2 values set respectively to 0, 0, 0.58, 1 .");'
|
testString: 'assert($("#red").css("animation-timing-function") == "cubic-bezier(0, 0, 0.58, 1)", "The value of the <code>animation-timing-function</code> property of the element with the id <code>red</code> should be a <code>cubic-bezier</code> function with x1, y1, x2, y2 values set respectively to 0, 0, 0.58, 1 .");'
|
||||||
- text: El elemento con el ID <code>red</code> ya no debería tener la propiedad de <code>animation-timing-function</code> lineal.
|
- text: El elemento con el ID <code>red</code> ya no debería tener la propiedad de <code>animation-timing-function</code> lineal.
|
||||||
testString: 'assert($("#red").css("animation-timing-function") !== "linear", "The element with the id <code>red</code> should no longer have the <code>animation-timing-function</code> property of linear.");'
|
testString: 'assert($("#red").css("animation-timing-function") !== "linear", "The element with the id <code>red</code> should no longer have the <code>animation-timing-function</code> property of linear.");'
|
||||||
|
@ -22,7 +22,7 @@ Aumente el tamaño del elemento con el id de <code>ball2</code> a 1.5 veces su t
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Establezca la propiedad de <code>transform</code> para <code>#ball2</code> para escalarla 1.5 veces su tamaño.'
|
- text: 'Establezca la propiedad de <code>transform</code> para <code>#ball2</code> para escalarla 1.5 veces su tamaño.'
|
||||||
testString: 'assert(code.match(/#ball2\s*?{\s*?left:\s*?65%;\s*?transform:\s*?scale\(1\.5\);\s*?}|#ball2\s*?{\s*?transform:\s*?scale\(1\.5\);\s*?left:\s*?65%;\s*?}/gi), "Set the <code>transform</code> property for <code>#ball2</code> to scale it 1.5 times its size.");'
|
testString: 'assert(code.match(/#ball2\s*?{\s*?left:\s*?65%;\s*?transform:\s*?scale\(1\.5\);\s*?}|#ball2\s*?{\s*?transform:\s*?scale\(1\.5\);\s*?left:\s*?65%;\s*?}/gi), "Set the <code>transform</code> property for <code>#ball2</code> to scale it 1.5 times its size.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -25,7 +25,7 @@ tests:
|
|||||||
testString: 'assert($("s").length == 1, "Your code should add one <code>s</code> tag to the markup.");'
|
testString: 'assert($("s").length == 1, "Your code should add one <code>s</code> tag to the markup.");'
|
||||||
- text: La etiqueta <code>s</code> debe envolver el texto de Google en la etiqueta <code>h4</code> . No debe contener la palabra Alfabeto.
|
- text: La etiqueta <code>s</code> debe envolver el texto de Google en la etiqueta <code>h4</code> . No debe contener la palabra Alfabeto.
|
||||||
testString: 'assert($("s").text().match(/Google/gi) && !$("s").text().match(/Alphabet/gi), "A <code>s</code> tag should wrap around the Google text in the <code>h4</code> tag. It should not contain the word Alphabet.");'
|
testString: 'assert($("s").text().match(/Google/gi) && !$("s").text().match(/Alphabet/gi), "A <code>s</code> tag should wrap around the Google text in the <code>h4</code> tag. It should not contain the word Alphabet.");'
|
||||||
- text: 'Incluya la palabra Alfabeto en la etiqueta <code>h4</code> , sin tachar el formato.'
|
- text: 'Incluya la palabra Alfabeto en la etiqueta <code>h4</code> , sin tachar el formato.'
|
||||||
testString: 'assert($("h4").html().match(/Alphabet/gi), "Include the word Alphabet in the <code>h4</code> tag, without strikethrough formatting.");'
|
testString: 'assert($("h4").html().match(/Alphabet/gi), "Include the word Alphabet in the <code>h4</code> tag, without strikethrough formatting.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ Nota: este desafío permite múltiples soluciones posibles. Por ejemplo, puede a
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: El elemento de su imagen debe tener la clase "borde verde grueso".
|
- text: El elemento de su imagen debe tener la clase "borde verde grueso."
|
||||||
testString: 'assert($("img").hasClass("thick-green-border"), "Your image element should have the class "thick-green-border".");'
|
testString: 'assert($("img").hasClass("thick-green-border"), "Your image element should have the class "thick-green-border".");'
|
||||||
- text: Su imagen debe tener un radio de borde de <code clase = "notranslate"> 10px </code>
|
- text: Su imagen debe tener un radio de borde de <code clase = "notranslate"> 10px </code>
|
||||||
testString: 'assert(parseInt($("img").css("border-top-left-radius")) > 8, "Your image should have a border radius of <code>10px</code>");'
|
testString: 'assert(parseInt($("img").css("border-top-left-radius")) > 8, "Your image should have a border radius of <code>10px</code>");'
|
||||||
|
@ -23,7 +23,7 @@ Defina una variable llamada <code>--penguin-belly</code> en el selector de <code
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'declara la variable <code>--penguin-belly</code> en la <code>:root</code> y <code>--penguin-belly</code> a <code>pink</code> '.
|
- text: 'declara la variable <code>--penguin-belly</code> en la <code>:root</code> y <code>--penguin-belly</code> a <code>pink</code> '
|
||||||
testString: 'assert(code.match(/:root\s*?{[\s\S]*--penguin-belly\s*?:\s*?pink\s*?;[\s\S]*}/gi), "declare the <code>--penguin-belly</code> variable in the <code>:root</code> and assign it to <code>pink</code>.");'
|
testString: 'assert(code.match(/:root\s*?{[\s\S]*--penguin-belly\s*?:\s*?pink\s*?;[\s\S]*}/gi), "declare the <code>--penguin-belly</code> variable in the <code>:root</code> and assign it to <code>pink</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,7 +22,7 @@ Dentro de la misma etiqueta <code><style></code> que contiene su clase de
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Entre las etiquetas de <code>style</code> , <code>16px</code> elementos <code>p</code> <code>font-size</code> de <code>font-size</code> de <code>16px</code> . El navegador y el zoom de texto deben estar al 100% ".
|
- text: 'Entre las etiquetas de <code>style</code> , <code>16px</code> elementos <code>p</code> <code>font-size</code> de <code>font-size</code> de <code>16px</code> . El navegador y el zoom de texto deben estar al 100% ".
|
||||||
testString: 'assert(code.match(/p\s*{\s*font-size\s*:\s*16\s*px\s*;\s*}/i), "Between the <code>style</code> tags, give the <code>p</code> elements <code>font-size</code> of <code>16px</code>. Browser and Text zoom should be at 100%.");'
|
testString: 'assert(code.match(/p\s*{\s*font-size\s*:\s*16\s*px\s*;\s*}/i), "Between the <code>style</code> tags, give the <code>p</code> elements <code>font-size</code> of <code>16px</code>. Browser and Text zoom should be at 100%.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -32,7 +32,7 @@ tests:
|
|||||||
testString: 'assert($("h1").hasClass("blue-text"), "Your <code>h1</code> element should have the class <code>blue-text</code>.");'
|
testString: 'assert($("h1").hasClass("blue-text"), "Your <code>h1</code> element should have the class <code>blue-text</code>.");'
|
||||||
- text: Su elemento <code>h1</code> debe tener el ID de <code>orange-text</code> .
|
- text: Su elemento <code>h1</code> debe tener el ID de <code>orange-text</code> .
|
||||||
testString: 'assert($("h1").attr("id") === "orange-text", "Your <code>h1</code> element should have the id of <code>orange-text</code>.");'
|
testString: 'assert($("h1").attr("id") === "orange-text", "Your <code>h1</code> element should have the id of <code>orange-text</code>.");'
|
||||||
- text: 'Su elemento <code>h1</code> debe tener el estilo de <code>color: white</code> '.
|
- text: 'Su elemento <code>h1</code> debe tener el estilo de <code>color: white</code> '
|
||||||
testString: 'assert(code.match(/<h1.*style/gi) && code.match(/<h1.*style.*color\s*?:/gi), "Your <code>h1</code> element should have the inline style of <code>color: white</code>.");'
|
testString: 'assert(code.match(/<h1.*style/gi) && code.match(/<h1.*style.*color\s*?:/gi), "Your <code>h1</code> element should have the inline style of <code>color: white</code>.");'
|
||||||
- text: Su declaración de clase de <code>pink-text</code> debe tener la palabra clave <code>!important</code> para anular todas las demás declaraciones.
|
- text: Su declaración de clase de <code>pink-text</code> debe tener la palabra clave <code>!important</code> para anular todas las demás declaraciones.
|
||||||
testString: 'assert(code.match(/\.pink-text\s*?\{[\s\S]*?color:.*pink.*!important\s*;?[^\.]*\}/g), "Your <code>pink-text</code> class declaration should have the <code>!important</code> keyword to override all other declarations.");'
|
testString: 'assert(code.match(/\.pink-text\s*?\{[\s\S]*?color:.*pink.*!important\s*;?[^\.]*\}/g), "Your <code>pink-text</code> class declaration should have the <code>!important</code> keyword to override all other declarations.");'
|
||||||
|
@ -26,7 +26,7 @@ Dale a tu elemento <code>h1</code> la clase de <code>pink-text</code> .
|
|||||||
tests:
|
tests:
|
||||||
- text: Su elemento <code>h1</code> debe tener la clase <code>pink-text</code> .
|
- text: Su elemento <code>h1</code> debe tener la clase <code>pink-text</code> .
|
||||||
testString: 'assert($("h1").hasClass("pink-text"), "Your <code>h1</code> element should have the class <code>pink-text</code>.");'
|
testString: 'assert($("h1").hasClass("pink-text"), "Your <code>h1</code> element should have the class <code>pink-text</code>.");'
|
||||||
- text: 'Tu <code><style></code> debe tener una clase de CSS de <code>pink-text</code> que cambie el <code>color</code> .'
|
- text: 'Tu <code><style></code> debe tener una clase de CSS de <code>pink-text</code> que cambie el <code>color</code> .'
|
||||||
testString: 'assert(code.match(/\.pink-text\s*\{\s*color\s*:\s*.+\s*;\s*\}/g), "Your <code><style></code> should have a <code>pink-text</code> CSS class that changes the <code>color</code>.");'
|
testString: 'assert(code.match(/\.pink-text\s*\{\s*color\s*:\s*.+\s*;\s*\}/g), "Your <code><style></code> should have a <code>pink-text</code> CSS class that changes the <code>color</code>.");'
|
||||||
- text: Tu elemento <code>h1</code> debe ser rosa.
|
- text: Tu elemento <code>h1</code> debe ser rosa.
|
||||||
testString: 'assert($("h1").css("color") === "rgb(255, 192, 203)", "Your <code>h1</code> element should be pink.");'
|
testString: 'assert($("h1").css("color") === "rgb(255, 192, 203)", "Your <code>h1</code> element should be pink.");'
|
||||||
|
@ -31,9 +31,9 @@ tests:
|
|||||||
testString: 'assert($("h2").css("font-family").match(/^"?lobster/i), "Your h2 element should use the font <code>Lobster</code>.");'
|
testString: 'assert($("h2").css("font-family").match(/^"?lobster/i), "Your h2 element should use the font <code>Lobster</code>.");'
|
||||||
- text: Su elemento h2 debería degradarse a la fuente <code>monospace</code> cuando <code>Lobster</code> no está disponible.
|
- text: Su elemento h2 debería degradarse a la fuente <code>monospace</code> cuando <code>Lobster</code> no está disponible.
|
||||||
testString: 'assert(/\s*h2\s*\{\s*font-family\:\s*(\"|")?Lobster(\"|")?,\s*monospace\s*;\s*\}/gi.test(code), "Your h2 element should degrade to the font <code>monospace</code> when <code>Lobster</code> is not available.");'
|
testString: 'assert(/\s*h2\s*\{\s*font-family\:\s*(\"|")?Lobster(\"|")?,\s*monospace\s*;\s*\}/gi.test(code), "Your h2 element should degrade to the font <code>monospace</code> when <code>Lobster</code> is not available.");'
|
||||||
- text: Comente su llamada a Google para la fuente <code>Lobster</code> colocando <code><!--</code> delante de ella. '
|
- text: Comente su llamada a Google para la fuente <code>Lobster</code> colocando <code><!--</code> delante de ella. '
|
||||||
testString: 'assert(new RegExp("<!--[^fc]", "gi").test(code), "Comment out your call to Google for the <code>Lobster</code> font by putting <code><!--</code> in front of it.");'
|
testString: 'assert(new RegExp("<!--[^fc]", "gi").test(code), "Comment out your call to Google for the <code>Lobster</code> font by putting <code><!--</code> in front of it.");'
|
||||||
- text: 'Asegúrate de cerrar tu comentario agregando <code>--></code> .'
|
- text: 'Asegúrate de cerrar tu comentario agregando <code>--></code> .'
|
||||||
testString: 'assert(new RegExp("[^fc]-->", "gi").test(code), "Be sure to close your comment by adding <code>--></code>.");'
|
testString: 'assert(new RegExp("[^fc]-->", "gi").test(code), "Be sure to close your comment by adding <code>--></code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -34,7 +34,7 @@ tests:
|
|||||||
testString: 'assert($("h2").hasClass("red-text"), "Your <code>h2</code> element should have the class <code>red-text</code>.");'
|
testString: 'assert($("h2").hasClass("red-text"), "Your <code>h2</code> element should have the class <code>red-text</code>.");'
|
||||||
- text: Su hoja de estilo debe declarar una clase de <code>red-text</code> y tener su color establecido en rojo.
|
- text: Su hoja de estilo debe declarar una clase de <code>red-text</code> y tener su color establecido en rojo.
|
||||||
testString: 'assert(code.match(/\.red-text\s*\{\s*color\s*:\s*red;\s*\}/g), "Your stylesheet should declare a <code>red-text</code> class and have its color set to red.");'
|
testString: 'assert(code.match(/\.red-text\s*\{\s*color\s*:\s*red;\s*\}/g), "Your stylesheet should declare a <code>red-text</code> class and have its color set to red.");'
|
||||||
- text: 'No utilice declaraciones de estilo en línea como <code>style="color: red"</code> en su elemento <code>h2</code> .'
|
- text: 'No utilice declaraciones de estilo en línea como <code>style="color: red"</code> en su elemento <code>h2</code> .'
|
||||||
testString: 'assert($("h2").attr("style") === undefined, "Do not use inline style declarations like <code>style="color: red"</code> in your <code>h2</code> element.");'
|
testString: 'assert($("h2").attr("style") === undefined, "Do not use inline style declarations like <code>style="color: red"</code> in your <code>h2</code> element.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,9 +22,9 @@ En el <code>:root</code> selector de <code>:root</code> de la <code>media query<
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>:root</code> debe reasignar la variable <code>--penguin-size</code> a <code>200px</code> .'
|
- text: ' <code>:root</code> debe reasignar la variable <code>--penguin-size</code> a <code>200px</code> .'
|
||||||
testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-size\s*?:\s*?200px\s*?;[\s\S]*}[\s\S]*}/gi), "<code>:root</code> should reassign the <code>--penguin-size</code> variable to <code>200px</code>.");'
|
testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-size\s*?:\s*?200px\s*?;[\s\S]*}[\s\S]*}/gi), "<code>:root</code> should reassign the <code>--penguin-size</code> variable to <code>200px</code>.");'
|
||||||
- text: ' <code>:root</code> debería reasignar la variable <code>--penguin-skin</code> a <code>black</code> '.
|
- text: ' <code>:root</code> debería reasignar la variable <code>--penguin-skin</code> a <code>black</code> '
|
||||||
testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-skin\s*?:\s*?black\s*?;[\s\S]*}[\s\S]*}/gi), "<code>:root</code> should reassign the <code>--penguin-skin</code> variable to <code>black</code>.");'
|
testString: 'assert(code.match(/media\s*?\(\s*?max-width\s*?:\s*?350px\s*?\)\s*?{[\s\S]*:root\s*?{[\s\S]*--penguin-skin\s*?:\s*?black\s*?;[\s\S]*}[\s\S]*}/gi), "<code>:root</code> should reassign the <code>--penguin-skin</code> variable to <code>black</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,19 +26,19 @@ Adelante, intente usar los códigos hexadecimales abreviados para colorear los e
|
|||||||
tests:
|
tests:
|
||||||
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am red!</code> El <code>color</code> rojo.
|
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am red!</code> El <code>color</code> rojo.
|
||||||
testString: 'assert($(".red-text").css("color") === "rgb(255, 0, 0)", "Give your <code>h1</code> element with the text <code>I am red!</code> the <code>color</code> red.");'
|
testString: 'assert($(".red-text").css("color") === "rgb(255, 0, 0)", "Give your <code>h1</code> element with the text <code>I am red!</code> the <code>color</code> red.");'
|
||||||
- text: 'Use el <code>hex code</code> abreviado para el color rojo en lugar del código hexadecimal <code>#FF0000</code> .'
|
- text: 'Use el <code>hex code</code> abreviado para el color rojo en lugar del código hexadecimal <code>#FF0000</code> .'
|
||||||
testString: 'assert(code.match(/\.red-text\s*?{\s*?color:\s*?#F00\s*?;\s*?}/gi), "Use the abbreviate <code>hex code</code> for the color red instead of the hex code <code>#FF0000</code>.");'
|
testString: 'assert(code.match(/\.red-text\s*?{\s*?color:\s*?#F00\s*?;\s*?}/gi), "Use the abbreviate <code>hex code</code> for the color red instead of the hex code <code>#FF0000</code>.");'
|
||||||
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am green!</code> El <code>color</code> verde.
|
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am green!</code> El <code>color</code> verde.
|
||||||
testString: 'assert($(".green-text").css("color") === "rgb(0, 255, 0)", "Give your <code>h1</code> element with the text <code>I am green!</code> the <code>color</code> green.");'
|
testString: 'assert($(".green-text").css("color") === "rgb(0, 255, 0)", "Give your <code>h1</code> element with the text <code>I am green!</code> the <code>color</code> green.");'
|
||||||
- text: 'Use el <code>hex code</code> abreviado para el color verde en lugar del código hexadecimal <code>#00FF00</code> .'
|
- text: 'Use el <code>hex code</code> abreviado para el color verde en lugar del código hexadecimal <code>#00FF00</code> .'
|
||||||
testString: 'assert(code.match(/\.green-text\s*?{\s*?color:\s*?#0F0\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color green instead of the hex code <code>#00FF00</code>.");'
|
testString: 'assert(code.match(/\.green-text\s*?{\s*?color:\s*?#0F0\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color green instead of the hex code <code>#00FF00</code>.");'
|
||||||
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am cyan!</code> El <code>color</code> cian.
|
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am cyan!</code> El <code>color</code> cian.
|
||||||
testString: 'assert($(".cyan-text").css("color") === "rgb(0, 255, 255)", "Give your <code>h1</code> element with the text <code>I am cyan!</code> the <code>color</code> cyan.");'
|
testString: 'assert($(".cyan-text").css("color") === "rgb(0, 255, 255)", "Give your <code>h1</code> element with the text <code>I am cyan!</code> the <code>color</code> cyan.");'
|
||||||
- text: 'Use el <code>hex code</code> abreviado para el color cian en lugar del código hexadecimal <code>#00FFFF</code> '.
|
- text: 'Use el <code>hex code</code> abreviado para el color cian en lugar del código hexadecimal <code>#00FFFF</code> '
|
||||||
testString: 'assert(code.match(/\.cyan-text\s*?{\s*?color:\s*?#0FF\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color cyan instead of the hex code <code>#00FFFF</code>.");'
|
testString: 'assert(code.match(/\.cyan-text\s*?{\s*?color:\s*?#0FF\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color cyan instead of the hex code <code>#00FFFF</code>.");'
|
||||||
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am fuchsia!</code> El <code>color</code> fucsia.
|
- text: ¡Da tu elemento <code>h1</code> con el texto <code>I am fuchsia!</code> El <code>color</code> fucsia.
|
||||||
testString: 'assert($(".fuchsia-text").css("color") === "rgb(255, 0, 255)", "Give your <code>h1</code> element with the text <code>I am fuchsia!</code> the <code>color</code> fuchsia.");'
|
testString: 'assert($(".fuchsia-text").css("color") === "rgb(255, 0, 255)", "Give your <code>h1</code> element with the text <code>I am fuchsia!</code> the <code>color</code> fuchsia.");'
|
||||||
- text: 'Use el <code>hex code</code> abreviado para el color fucsia en lugar del código hexadecimal <code>#FF00FF</code> '.
|
- text: 'Use el <code>hex code</code> abreviado para el color fucsia en lugar del código hexadecimal <code>#FF00FF</code> '
|
||||||
testString: 'assert(code.match(/\.fuchsia-text\s*?{\s*?color:\s*?#F0F\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color fuchsia instead of the hex code <code>#FF00FF</code>.");'
|
testString: 'assert(code.match(/\.fuchsia-text\s*?{\s*?color:\s*?#F0F\s*?;\s*?}/gi), "Use the abbreviated <code>hex code</code> for the color fuchsia instead of the hex code <code>#FF00FF</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ tests:
|
|||||||
testString: 'assert($("form").children("button").length > 0, "Your form should have a button inside it.");'
|
testString: 'assert($("form").children("button").length > 0, "Your form should have a button inside it.");'
|
||||||
- text: El botón de envío debe tener el atributo <code class = "notranslate"> type </code> establecido en <code class = "notranslate"> submit </code>.
|
- text: El botón de envío debe tener el atributo <code class = "notranslate"> type </code> establecido en <code class = "notranslate"> submit </code>.
|
||||||
testString: 'assert($("button").attr("type") === "submit", "Your submit button should have the attribute <code>type</code> set to <code>submit</code>.");'
|
testString: 'assert($("button").attr("type") === "submit", "Your submit button should have the attribute <code>type</code> set to <code>submit</code>.");'
|
||||||
- text: Su botón de enviar solo debe tener el texto "Enviar".
|
- text: Su botón de enviar solo debe tener el texto "Enviar."
|
||||||
testString: 'assert($("button").text().match(/^\s*submit\s*$/gi), "Your submit button should only have the text "Submit".");'
|
testString: 'assert($("button").text().match(/^\s*submit\s*$/gi), "Your submit button should only have the text "Submit".");'
|
||||||
- text: Asegúrese de que su elemento <code class = "notranslate"> button </code> tenga una etiqueta de cierre.
|
- text: Asegúrese de que su elemento <code class = "notranslate"> button </code> tenga una etiqueta de cierre.
|
||||||
testString: 'assert(code.match(/<\/button>/g) && code.match(/<button/g) && code.match(/<\/button>/g).length === code.match(/<button/g).length, "Make sure your <code>button</code> element has a closing tag.");'
|
testString: 'assert(code.match(/<\/button>/g) && code.match(/<button/g) && code.match(/<\/button>/g).length === code.match(/<button/g).length, "Make sure your <code>button</code> element has a closing tag.");'
|
||||||
|
@ -28,7 +28,7 @@ tests:
|
|||||||
testString: 'assert(($("h2").length > 0), "Leave your <code>h2</code> element uncommented so that it is visible on your page.");'
|
testString: 'assert(($("h2").length > 0), "Leave your <code>h2</code> element uncommented so that it is visible on your page.");'
|
||||||
- text: Comenta tu elemento <code>p</code> para que no se vea en tu página.
|
- text: Comenta tu elemento <code>p</code> para que no se vea en tu página.
|
||||||
testString: 'assert(($("p").length === 0), "Comment out your <code>p</code> element so that it is not visible on your page.");'
|
testString: 'assert(($("p").length === 0), "Comment out your <code>p</code> element so that it is not visible on your page.");'
|
||||||
- text: 'Asegúrese de cerrar cada uno de sus comentarios con <code>--></code> .'
|
- text: 'Asegúrese de cerrar cada uno de sus comentarios con <code>--></code> .'
|
||||||
testString: 'assert(code.match(/[^fc]-->/g).length > 1, "Be sure to close each of your comments with <code>--></code>.");'
|
testString: 'assert(code.match(/[^fc]-->/g).length > 1, "Be sure to close each of your comments with <code>--></code>.");'
|
||||||
- text: No cambie el orden de <code>h1</code> <code>h2</code> o <code>p</code> en el código.
|
- text: No cambie el orden de <code>h1</code> <code>h2</code> o <code>p</code> en el código.
|
||||||
testString: 'assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="<h1>" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="<h2>" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="<p>") , "Do not change the order of the <code>h1</code> <code>h2</code> or <code>p</code> in the code.");'
|
testString: 'assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="<h1>" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="<h2>" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="<p>") , "Do not change the order of the <code>h1</code> <code>h2</code> or <code>p</code> in the code.");'
|
||||||
|
@ -27,7 +27,7 @@ Crear una <code>a</code> elemento que une a <code>http://freecatphotoapp.com</co
|
|||||||
tests:
|
tests:
|
||||||
- text: Su <code>a</code> elemento debe tener el <code>anchor text</code> de fotos "gato".
|
- text: Su <code>a</code> elemento debe tener el <code>anchor text</code> de fotos "gato".
|
||||||
testString: 'assert((/cat photos/gi).test($("a").text()), "Your <code>a</code> element should have the <code>anchor text</code> of "cat photos".");'
|
testString: 'assert((/cat photos/gi).test($("a").text()), "Your <code>a</code> element should have the <code>anchor text</code> of "cat photos".");'
|
||||||
- text: 'Es necesario un <code>a</code> elemento que une a <code>http://freecatphotoapp .com</code> '
|
- text: 'Es necesario un <code>a</code> elemento que une a <code>http://freecatphotoapp .com</code> '
|
||||||
testString: 'assert(/http:\/\/(www\.)?freecatphotoapp\.com/gi.test($("a").attr("href")), "You need an <code>a</code> element that links to <code>http://freecatphotoapp<wbr>.com</code>");'
|
testString: 'assert(/http:\/\/(www\.)?freecatphotoapp\.com/gi.test($("a").attr("href")), "You need an <code>a</code> element that links to <code>http://freecatphotoapp<wbr>.com</code>");'
|
||||||
- text: Asegúrese de que su <code>a</code> elemento tiene una etiqueta de cierre.
|
- text: Asegúrese de que su <code>a</code> elemento tiene una etiqueta de cierre.
|
||||||
testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/<a/g).length, "Make sure your <code>a</code> element has a closing tag.");'
|
testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/<a/g).length, "Make sure your <code>a</code> element has a closing tag.");'
|
||||||
|
@ -35,9 +35,9 @@ tests:
|
|||||||
testString: 'assert($("a").eq(0).attr("href") == "#footer", "The <code>a</code> tag should have an <code>href</code> attribute set to "#footer".");'
|
testString: 'assert($("a").eq(0).attr("href") == "#footer", "The <code>a</code> tag should have an <code>href</code> attribute set to "#footer".");'
|
||||||
- text: La etiqueta <code class = "notranslate"> a </code> no debe tener el atributo <code class = "notranslate"> target </code>
|
- text: La etiqueta <code class = "notranslate"> a </code> no debe tener el atributo <code class = "notranslate"> target </code>
|
||||||
testString: 'assert(typeof $("a").eq(0).attr("target") == typeof undefined || $("a").eq(0).attr("target") == true, "The <code>a</code> tag should not have a <code>target</code> attribute");'
|
testString: 'assert(typeof $("a").eq(0).attr("target") == typeof undefined || $("a").eq(0).attr("target") == true, "The <code>a</code> tag should not have a <code>target</code> attribute");'
|
||||||
- text: El <code class = "notranslate"> un texto </code> debe ser "Jump to Bottom".
|
- text: El <code class = "notranslate"> un texto </code> debe ser "Jump to Bottom."
|
||||||
testString: 'assert($("a").eq(0).text().match(/Jump to Bottom/gi), "The <code>a</code> text should be "Jump to Bottom".");'
|
testString: 'assert($("a").eq(0).text().match(/Jump to Bottom/gi), "The <code>a</code> text should be "Jump to Bottom".");'
|
||||||
- text: La etiqueta <code class = "notranslate"> footer </code> debe tener un atributo <code class = "notranslate"> id </code> establecido en "footer".
|
- text: La etiqueta <code class = "notranslate"> footer </code> debe tener un atributo <code class = "notranslate"> id </code> establecido en "footer."
|
||||||
testString: 'assert($("footer").eq(0).attr("id") == "footer", "The <code>footer</code> tag should have an <code>id</code> attribute set to "footer".");'
|
testString: 'assert($("footer").eq(0).attr("id") == "footer", "The <code>footer</code> tag should have an <code>id</code> attribute set to "footer".");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ Por ejemplo: <code>href="#"</code>
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Su <code>a</code> elemento debe ser un vínculo roto con el valor de la <code>href</code> atributo establecido en '#'.'
|
- text: 'Su <code>a</code> elemento debe ser un vínculo roto con el valor de la <code>href</code> atributo establecido en '#'.'
|
||||||
testString: 'assert($("a").attr("href") === "#", "Your <code>a</code> element should be a dead link with the value of the <code>href</code> attribute set to "#".");'
|
testString: 'assert($("a").attr("href") === "#", "Your <code>a</code> element should be a dead link with the value of the <code>href</code> attribute set to "#".");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -29,7 +29,7 @@ Ahora nido de su actual <code>a</code> elemento dentro de un nuevo <code>p</code
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Es necesario un <code>a</code> elemento que une a 'http://freecatphotoapp.com'.'
|
- text: 'Es necesario un <code>a</code> elemento que une a 'http://freecatphotoapp.com'.'
|
||||||
testString: 'assert(($("a[href=\"http://freecatphotoapp.com\"]").length > 0 || $("a[href=\"http://www.freecatphotoapp.com\"]").length > 0), "You need an <code>a</code> element that links to "http://freecatphotoapp.com".");'
|
testString: 'assert(($("a[href=\"http://freecatphotoapp.com\"]").length > 0 || $("a[href=\"http://www.freecatphotoapp.com\"]").length > 0), "You need an <code>a</code> element that links to "http://freecatphotoapp.com".");'
|
||||||
- text: Su <code>a</code> elemento debe tener el texto de anclaje de fotos "gato"
|
- text: Su <code>a</code> elemento debe tener el texto de anclaje de fotos "gato"
|
||||||
testString: 'assert($("a").text().match(/cat\sphotos/gi), "Your <code>a</code> element should have the anchor text of "cat photos"");'
|
testString: 'assert($("a").text().match(/cat\sphotos/gi), "Your <code>a</code> element should have the anchor text of "cat photos"");'
|
||||||
|
@ -27,7 +27,7 @@ Una vez que hayas hecho esto, desplázate sobre tu imagen con el cursor. El punt
|
|||||||
tests:
|
tests:
|
||||||
- text: Nido el vigente <code>img</code> elemento dentro de un <code>a</code> elemento.
|
- text: Nido el vigente <code>img</code> elemento dentro de un <code>a</code> elemento.
|
||||||
testString: 'assert($("a").children("img").length > 0, "Nest the existing <code>img</code> element within an <code>a</code> element.");'
|
testString: 'assert($("a").children("img").length > 0, "Nest the existing <code>img</code> element within an <code>a</code> element.");'
|
||||||
- text: 'Su <code>a</code> elemento debe ser un vínculo roto con un <code>href</code> atributo establecido en <code>#</code> .'
|
- text: 'Su <code>a</code> elemento debe ser un vínculo roto con un <code>href</code> atributo establecido en <code>#</code> .'
|
||||||
testString: 'assert(new RegExp("#").test($("a").children("img").parent().attr("href")), "Your <code>a</code> element should be a dead link with a <code>href</code> attribute set to <code>#</code>.");'
|
testString: 'assert(new RegExp("#").test($("a").children("img").parent().attr("href")), "Your <code>a</code> element should be a dead link with a <code>href</code> attribute set to <code>#</code>.");'
|
||||||
- text: Asegúrese de que cada uno de sus <code>a</code> elementos tiene una etiqueta de cierre.
|
- text: Asegúrese de que cada uno de sus <code>a</code> elementos tiene una etiqueta de cierre.
|
||||||
testString: 'assert(code.match(/<\/a>/g) && code.match(/<a/g) && code.match(/<\/a>/g).length === code.match(/<a/g).length, "Make sure each of your <code>a</code> elements has a closing tag.");'
|
testString: 'assert(code.match(/<\/a>/g) && code.match(/<a/g) && code.match(/<\/a>/g).length === code.match(/<a/g).length, "Make sure each of your <code>a</code> elements has a closing tag.");'
|
||||||
|
@ -29,7 +29,7 @@ tests:
|
|||||||
testString: 'assert($("h2").length > 0, "Make your <code>h2</code> element visible on your page by uncommenting it.");'
|
testString: 'assert($("h2").length > 0, "Make your <code>h2</code> element visible on your page by uncommenting it.");'
|
||||||
- text: Haz que tu elemento <code>p</code> visible en tu página descomprimiéndolo.
|
- text: Haz que tu elemento <code>p</code> visible en tu página descomprimiéndolo.
|
||||||
testString: 'assert($("p").length > 0, "Make your <code>p</code> element visible on your page by uncommenting it.");'
|
testString: 'assert($("p").length > 0, "Make your <code>p</code> element visible on your page by uncommenting it.");'
|
||||||
- text: 'Asegúrese de eliminar todas las etiquetas de comentarios finales, es decir, <code>--></code> .'
|
- text: 'Asegúrese de eliminar todas las etiquetas de comentarios finales, es decir, <code>--></code> .'
|
||||||
testString: 'assert(!/[^fc]-->/gi.test(code.replace(/ *<!--[^fc]*\n/g,"")), "Be sure to delete all trailing comment tags, i.e. <code>--></code>.");'
|
testString: 'assert(!/[^fc]-->/gi.test(code.replace(/ *<!--[^fc]*\n/g,"")), "Be sure to delete all trailing comment tags, i.e. <code>--></code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,7 +26,7 @@ Un ejemplo ayuda a mostrar esta propiedad en acción. Agregue la propiedad CSS <
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-container</code> debería tener una propiedad <code>align-items</code> establecida en un valor de center.'
|
- text: 'El elemento <code>#box-container</code> debería tener una propiedad <code>align-items</code> establecida en un valor de center.'
|
||||||
testString: 'assert($("#box-container").css("align-items") == "center", "The <code>#box-container</code> element should have an <code>align-items</code> property set to a value of center.");'
|
testString: 'assert($("#box-container").css("align-items") == "center", "The <code>#box-container</code> element should have an <code>align-items</code> property set to a value of center.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,7 +26,7 @@ Un ejemplo ayuda a mostrar esta propiedad en acción. Agregue la propiedad CSS <
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-container</code> debería tener una propiedad <code>justify-content</code> establecida en un valor de center'.
|
- text: 'El elemento <code>#box-container</code> debería tener una propiedad <code>justify-content</code> establecida en un valor de center'
|
||||||
testString: 'assert($("#box-container").css("justify-content") == "center", "The <code>#box-container</code> element should have a <code>justify-content</code> property set to a value of center.");'
|
testString: 'assert($("#box-container").css("justify-content") == "center", "The <code>#box-container</code> element should have a <code>justify-content</code> property set to a value of center.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,7 +22,7 @@ Agregue la <code>display</code> propiedades CSS a <code>#box-container</code> y
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>#box-container</code> debería tener la propiedad de <code>display</code> establecida en un valor de flex'.
|
- text: ' <code>#box-container</code> debería tener la propiedad de <code>display</code> establecida en un valor de flex'
|
||||||
testString: 'assert($("#box-container").css("display") == "flex", "<code>#box-container</code> should have the <code>display</code> property set to a value of flex.");'
|
testString: 'assert($("#box-container").css("display") == "flex", "<code>#box-container</code> should have the <code>display</code> property set to a value of flex.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,9 +22,9 @@ Agregue la propiedad CSS <code>align-self</code> a <code>#box-1</code> y <code>#
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>align-self</code> establecida en un valor de center.'
|
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>align-self</code> establecida en un valor de center.'
|
||||||
testString: 'assert($("#box-1").css("align-self") == "center", "The <code>#box-1</code> element should have the <code>align-self</code> property set to a value of center.");'
|
testString: 'assert($("#box-1").css("align-self") == "center", "The <code>#box-1</code> element should have the <code>align-self</code> property set to a value of center.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>align-self</code> establecida en un valor de flex-end.'
|
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>align-self</code> establecida en un valor de flex-end.'
|
||||||
testString: 'assert($("#box-2").css("align-self") == "flex-end", "The <code>#box-2</code> element should have the <code>align-self</code> property set to a value of flex-end.");'
|
testString: 'assert($("#box-2").css("align-self") == "flex-end", "The <code>#box-2</code> element should have the <code>align-self</code> property set to a value of flex-end.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,13 +22,13 @@ Establezca el tamaño inicial de las cajas utilizando <code>flex-basis</code> .
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debería tener una propiedad de <code>flex-basis</code> .'
|
- text: 'El elemento <code>#box-1</code> debería tener una propiedad de <code>flex-basis</code> .'
|
||||||
testString: 'assert($("#box-1").css("flex-basis") != "auto", "The <code>#box-1</code> element should have a <code>flex-basis</code> property.");'
|
testString: 'assert($("#box-1").css("flex-basis") != "auto", "The <code>#box-1</code> element should have a <code>flex-basis</code> property.");'
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener un valor de <code>flex-basis</code> de <code>10em</code> '.
|
- text: 'El elemento <code>#box-1</code> debe tener un valor de <code>flex-basis</code> de <code>10em</code> '
|
||||||
testString: 'assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g), "The <code>#box-1</code> element should have a <code>flex-basis</code> value of <code>10em</code>.");'
|
testString: 'assert(code.match(/#box-1\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?10em;/g), "The <code>#box-1</code> element should have a <code>flex-basis</code> value of <code>10em</code>.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debería tener la propiedad de <code>flex-basis</code> .'
|
- text: 'El elemento <code>#box-2</code> debería tener la propiedad de <code>flex-basis</code> .'
|
||||||
testString: 'assert($("#box-2").css("flex-basis") != "auto", "The <code>#box-2</code> element should have the <code>flex-basis</code> property.");'
|
testString: 'assert($("#box-2").css("flex-basis") != "auto", "The <code>#box-2</code> element should have the <code>flex-basis</code> property.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener un valor de <code>flex-basis</code> de <code>20em</code> '.
|
- text: 'El elemento <code>#box-2</code> debe tener un valor de <code>flex-basis</code> de <code>20em</code> '
|
||||||
testString: 'assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g), "The <code>#box-2</code> element should have a <code>flex-basis</code> value of <code>20em</code>.");'
|
testString: 'assert(code.match(/#box-2\s*?{\s*?.*?\s*?.*?\s*?flex-basis:\s*?20em;/g), "The <code>#box-2</code> element should have a <code>flex-basis</code> value of <code>20em</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -21,7 +21,7 @@ Agregue la propiedad CSS <code>flex-direction</code> al elemento <code>#box-cont
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-container</code> debería tener una propiedad de <code>flex-direction</code> configurada en columna.'
|
- text: 'El elemento <code>#box-container</code> debería tener una propiedad de <code>flex-direction</code> configurada en columna.'
|
||||||
testString: 'assert($("#box-container").css("flex-direction") == "column", "The <code>#box-container</code> element should have a <code>flex-direction</code> property set to column.");'
|
testString: 'assert($("#box-container").css("flex-direction") == "column", "The <code>#box-container</code> element should have a <code>flex-direction</code> property set to column.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ Agregue la propiedad CSS <code>flex-direction</code> al elemento <code>#box-cont
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-container</code> debería tener una propiedad de <code>flex-direction</code> configurada para invertir la fila.'
|
- text: 'El elemento <code>#box-container</code> debería tener una propiedad de <code>flex-direction</code> configurada para invertir la fila.'
|
||||||
testString: 'assert($("#box-container").css("flex-direction") == "row-reverse", "The <code>#box-container</code> element should have a <code>flex-direction</code> property set to row-reverse.");'
|
testString: 'assert($("#box-container").css("flex-direction") == "row-reverse", "The <code>#box-container</code> element should have a <code>flex-direction</code> property set to row-reverse.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,9 +22,9 @@ Agregue la propiedad CSS <code>flex-grow</code> a <code>#box-1</code> y <code>#b
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 1.'
|
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 1.'
|
||||||
testString: 'assert($("#box-1").css("flex-grow") == "1", "The <code>#box-1</code> element should have the <code>flex-grow</code> property set to a value of 1.");'
|
testString: 'assert($("#box-1").css("flex-grow") == "1", "The <code>#box-1</code> element should have the <code>flex-grow</code> property set to a value of 1.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 2.'
|
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex-grow</code> establecida en un valor de 2.'
|
||||||
testString: 'assert($("#box-2").css("flex-grow") == "2", "The <code>#box-2</code> element should have the <code>flex-grow</code> property set to a value of 2.");'
|
testString: 'assert($("#box-2").css("flex-grow") == "2", "The <code>#box-2</code> element should have the <code>flex-grow</code> property set to a value of 2.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,11 +24,11 @@ Estos valores harán que <code>#box-1</code> crezca para llenar el espacio adici
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex</code> establecida en un valor de 2 2 150px.'
|
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex</code> establecida en un valor de 2 2 150px.'
|
||||||
testString: 'assert($("#box-1").css("flex-grow") == "2" && $("#box-1").css("flex-shrink") == "2" && $("#box-1").css("flex-basis") == "150px", "The <code>#box-1</code> element should have the <code>flex</code> property set to a value of 2 2 150px.");'
|
testString: 'assert($("#box-1").css("flex-grow") == "2" && $("#box-1").css("flex-shrink") == "2" && $("#box-1").css("flex-basis") == "150px", "The <code>#box-1</code> element should have the <code>flex</code> property set to a value of 2 2 150px.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex</code> establecida en un valor de 1 1 150px.'
|
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex</code> establecida en un valor de 1 1 150px.'
|
||||||
testString: 'assert($("#box-2").css("flex-grow") == "1" && $("#box-2").css("flex-shrink") == "1" && $("#box-2").css("flex-basis") == "150px", "The <code>#box-2</code> element should have the <code>flex</code> property set to a value of 1 1 150px.");'
|
testString: 'assert($("#box-2").css("flex-grow") == "1" && $("#box-2").css("flex-shrink") == "1" && $("#box-2").css("flex-basis") == "150px", "The <code>#box-2</code> element should have the <code>flex</code> property set to a value of 1 1 150px.");'
|
||||||
- text: 'Su código debe usar la propiedad <code>flex</code> para <code>#box-1</code> y <code>#box-2</code> .'
|
- text: 'Su código debe usar la propiedad <code>flex</code> para <code>#box-1</code> y <code>#box-2</code> .'
|
||||||
testString: 'assert(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g).length == 2, "Your code should use the <code>flex</code> property for <code>#box-1</code> and <code>#box-2</code>.");'
|
testString: 'assert(code.match(/flex:\s*?\d\s+?\d\s+?150px;/g).length == 2, "Your code should use the <code>flex</code> property for <code>#box-1</code> and <code>#box-2</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,9 +23,9 @@ Agregue la propiedad CSS <code>flex-shrink</code> a <code>#box-1</code> y <code>
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex-shrink</code> establecida en un valor de 1'.
|
- text: 'El elemento <code>#box-1</code> debe tener la propiedad <code>flex-shrink</code> establecida en un valor de 1'
|
||||||
testString: 'assert($("#box-1").css("flex-shrink") == "1", "The <code>#box-1</code> element should have the <code>flex-shrink</code> property set to a value of 1.");'
|
testString: 'assert($("#box-1").css("flex-shrink") == "1", "The <code>#box-1</code> element should have the <code>flex-shrink</code> property set to a value of 1.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex-shrink</code> establecida en un valor de 2'.
|
- text: 'El elemento <code>#box-2</code> debe tener la propiedad <code>flex-shrink</code> establecida en un valor de 2'
|
||||||
testString: 'assert($("#box-2").css("flex-shrink") == "2", "The <code>#box-2</code> element should have the <code>flex-shrink</code> property set to a value of 2.");'
|
testString: 'assert($("#box-2").css("flex-shrink") == "2", "The <code>#box-2</code> element should have the <code>flex-shrink</code> property set to a value of 2.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ El diseño actual tiene demasiados cuadros para una fila. Agregue la propiedad C
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-container</code> debería tener la propiedad <code>flex-wrap</code> establecida en un valor de wrap.'
|
- text: 'El elemento <code>#box-container</code> debería tener la propiedad <code>flex-wrap</code> establecida en un valor de wrap.'
|
||||||
testString: 'assert($("#box-container").css("flex-wrap") == "wrap", "The <code>#box-container</code> element should have the <code>flex-wrap</code> property set to a value of wrap.");'
|
testString: 'assert($("#box-container").css("flex-wrap") == "wrap", "The <code>#box-container</code> element should have the <code>flex-wrap</code> property set to a value of wrap.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -21,7 +21,7 @@ Añadir la propiedad CSS <code>justify-content</code> de la cabecera del <code>.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>.profile-name</code> debe tener la propiedad <code>.profile-name</code> <code>justify-content</code> establecida en cualquiera de estos valores: centro, inicio flexible, extremo flexible, espacio intermedio o espacio-alrededor.'
|
- text: 'El elemento <code>.profile-name</code> debe tener la propiedad <code>.profile-name</code> <code>justify-content</code> establecida en cualquiera de estos valores: centro, inicio flexible, extremo flexible, espacio intermedio o espacio-alrededor.'
|
||||||
testString: 'assert(code.match(/header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around)\s*;/g), "The <code>.profile-name</code> element should have the <code>justify-content</code> property set to any of these values: center, flex-start, flex-end, space-between, or space-around.");'
|
testString: 'assert(code.match(/header\s.profile-name\s*{\s*?.*?\s*?.*?\s*?\s*?.*?\s*?justify-content\s*:\s*(center|flex-start|flex-end|space-between|space-around)\s*;/g), "The <code>.profile-name</code> element should have the <code>justify-content</code> property set to any of these values: center, flex-start, flex-end, space-between, or space-around.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -21,9 +21,9 @@ Agregue el <code>order</code> propiedades CSS a <code>#box-1</code> y <code>#box
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El elemento <code>#box-1</code> debe tener la propiedad de <code>order</code> establecida en un valor de 2.'
|
- text: 'El elemento <code>#box-1</code> debe tener la propiedad de <code>order</code> establecida en un valor de 2.'
|
||||||
testString: 'assert($("#box-1").css("order") == "2", "The <code>#box-1</code> element should have the <code>order</code> property set to a value of 2.");'
|
testString: 'assert($("#box-1").css("order") == "2", "The <code>#box-1</code> element should have the <code>order</code> property set to a value of 2.");'
|
||||||
- text: 'El elemento <code>#box-2</code> debe tener la propiedad de <code>order</code> establecida en un valor de 1.'
|
- text: 'El elemento <code>#box-2</code> debe tener la propiedad de <code>order</code> establecida en un valor de 1.'
|
||||||
testString: 'assert($("#box-2").css("order") == "1", "The <code>#box-2</code> element should have the <code>order</code> property set to a value of 1.");'
|
testString: 'assert($("#box-2").css("order") == "1", "The <code>#box-2</code> element should have the <code>order</code> property set to a value of 1.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -27,7 +27,7 @@ Haz una cuadrícula con tres columnas cuyos anchos sean los siguientes: 1fr, 100
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'la clase <code>container</code> debe tener una propiedad de <code>grid-template-columns</code> que tenga tres columnas con los siguientes anchos: <code>1fr, 100px, and 2fr</code> '.
|
- text: 'la clase <code>container</code> debe tener una propiedad de <code>grid-template-columns</code> que tenga tres columnas con los siguientes anchos: <code>1fr, 100px, and 2fr</code> '
|
||||||
testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi), "<code>container</code> class should have a <code>grid-template-columns</code> property that has three columns with the following widths: <code>1fr, 100px, and 2fr</code>.");'
|
testString: 'assert(code.match(/.container\s*?{[\s\S]*grid-template-columns\s*?:\s*?1fr\s*?100px\s*?2fr\s*?;[\s\S]*}/gi), "<code>container</code> class should have a <code>grid-template-columns</code> property that has three columns with the following widths: <code>1fr, 100px, and 2fr</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -27,11 +27,11 @@ tests:
|
|||||||
testString: 'assert.strictEqual(booWho(true), true, "<code>booWho(true)</code> should return true.");'
|
testString: 'assert.strictEqual(booWho(true), true, "<code>booWho(true)</code> should return true.");'
|
||||||
- text: <code>booWho(false)</code> debe devolver verdadero.
|
- text: <code>booWho(false)</code> debe devolver verdadero.
|
||||||
testString: 'assert.strictEqual(booWho(false), true, "<code>booWho(false)</code> should return true.");'
|
testString: 'assert.strictEqual(booWho(false), true, "<code>booWho(false)</code> should return true.");'
|
||||||
- text: ' <code>booWho([1, 2, 3])</code> debe devolver falso.'
|
- text: ' <code>booWho([1, 2, 3])</code> debe devolver falso.'
|
||||||
testString: 'assert.strictEqual(booWho([1, 2, 3]), false, "<code>booWho([1, 2, 3])</code> should return false.");'
|
testString: 'assert.strictEqual(booWho([1, 2, 3]), false, "<code>booWho([1, 2, 3])</code> should return false.");'
|
||||||
- text: ' <code>booWho([].slice)</code> debe devolver falso.'
|
- text: ' <code>booWho([].slice)</code> debe devolver falso.'
|
||||||
testString: 'assert.strictEqual(booWho([].slice), false, "<code>booWho([].slice)</code> should return false.");'
|
testString: 'assert.strictEqual(booWho([].slice), false, "<code>booWho([].slice)</code> should return false.");'
|
||||||
- text: ' <code>booWho({ "a": 1 })</code> debe devolver falso.'
|
- text: ' <code>booWho({ "a": 1 })</code> debe devolver falso.'
|
||||||
testString: 'assert.strictEqual(booWho({ "a": 1 }), false, "<code>booWho({ "a": 1 })</code> should return false.");'
|
testString: 'assert.strictEqual(booWho({ "a": 1 }), false, "<code>booWho({ "a": 1 })</code> should return false.");'
|
||||||
- text: <code>booWho(1)</code> debe devolver falso.
|
- text: <code>booWho(1)</code> debe devolver falso.
|
||||||
testString: 'assert.strictEqual(booWho(1), false, "<code>booWho(1)</code> should return false.");'
|
testString: 'assert.strictEqual(booWho(1), false, "<code>booWho(1)</code> should return false.");'
|
||||||
|
@ -22,19 +22,19 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>chunkArrayInGroups(["a", "b", "c", "d"], 2)</code> debe devolver <code>[["a", "b"], ["c", "d"]]</code> .'
|
- text: ' <code>chunkArrayInGroups(["a", "b", "c", "d"], 2)</code> debe devolver <code>[["a", "b"], ["c", "d"]]</code> .'
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups(["a", "b", "c", "d"], 2), [["a", "b"], ["c", "d"]], "<code>chunkArrayInGroups(["a", "b", "c", "d"], 2)</code> should return <code>[["a", "b"], ["c", "d"]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups(["a", "b", "c", "d"], 2), [["a", "b"], ["c", "d"]], "<code>chunkArrayInGroups(["a", "b", "c", "d"], 2)</code> should return <code>[["a", "b"], ["c", "d"]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)</code> debe devolver <code>[[0, 1, 2], [3, 4, 5]]</code> .'
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)</code> debe devolver <code>[[0, 1, 2], [3, 4, 5]]</code> .'
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)</code> debe devolver <code>[[0, 1], [2, 3], [4, 5]]</code> .'
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)</code> debe devolver <code>[[0, 1], [2, 3], [4, 5]]</code> .'
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)</code> debe devolver <code>[[0, 1, 2, 3], [4, 5]]</code> .'
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)</code> debe devolver <code>[[0, 1, 2, 3], [4, 5]]</code> .'
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)</code> debe devolver <code>[[0, 1, 2], [3, 4, 5], [6]]</code> .'
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)</code> debe devolver <code>[[0, 1, 2], [3, 4, 5], [6]]</code> .'
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5], [6]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3), [[0, 1, 2], [3, 4, 5], [6]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5], [6]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)</code> debe devolver <code>[[0, 1, 2, 3], [4, 5, 6, 7], [8]]</code> . '
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)</code> debe devolver <code>[[0, 1, 2, 3], [4, 5, 6, 7], [8]]</code> . '
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5, 6, 7], [8]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5, 6, 7], [8]]</code>.");'
|
||||||
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)</code> debe devolver <code>[[0, 1], [2, 3], [4, 5], [6, 7], [8]]</code> .
|
- text: ' <code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)</code> debe devolver <code>[[0, 1], [2, 3], [4, 5], [6, 7], [8]]</code> .
|
||||||
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5], [6, 7], [8]]</code>.");'
|
testString: 'assert.deepEqual(chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2), [[0, 1], [2, 3], [4, 5], [6, 7], [8]], "<code>chunkArrayInGroups([0, 1, 2, 3, 4, 5, 6, 7, 8], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5], [6, 7], [8]]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,25 +23,25 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>confirmEnding("Bastian", "n")</code> debe devolver verdadero.'
|
- text: ' <code>confirmEnding("Bastian", "n")</code> debe devolver verdadero.'
|
||||||
testString: 'assert(confirmEnding("Bastian", "n") === true, "<code>confirmEnding("Bastian", "n")</code> should return true.");'
|
testString: 'assert(confirmEnding("Bastian", "n") === true, "<code>confirmEnding("Bastian", "n")</code> should return true.");'
|
||||||
- text: ' <code>confirmEnding("Congratulation", "on")</code> debe devolver verdadero.'
|
- text: ' <code>confirmEnding("Congratulation", "on")</code> debe devolver verdadero.'
|
||||||
testString: 'assert(confirmEnding("Congratulation", "on") === true, "<code>confirmEnding("Congratulation", "on")</code> should return true.");'
|
testString: 'assert(confirmEnding("Congratulation", "on") === true, "<code>confirmEnding("Congratulation", "on")</code> should return true.");'
|
||||||
- text: ' <code>confirmEnding("Connor", "n")</code> debe devolver falso.'
|
- text: ' <code>confirmEnding("Connor", "n")</code> debe devolver falso.'
|
||||||
testString: 'assert(confirmEnding("Connor", "n") === false, "<code>confirmEnding("Connor", "n")</code> should return false.");'
|
testString: 'assert(confirmEnding("Connor", "n") === false, "<code>confirmEnding("Connor", "n")</code> should return false.");'
|
||||||
- text: ' <code>confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")</code> debe devolver falso.
|
- text: ' <code>confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")</code> debe devolver falso.
|
||||||
testString: 'assert(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") === false, "<code>confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")</code> should return false.");'
|
testString: 'assert(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") === false, "<code>confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")</code> should return false.");'
|
||||||
- text: ' <code>confirmEnding("He has to give me a new name", "name")</code> debe devolver verdadero.'
|
- text: ' <code>confirmEnding("He has to give me a new name", "name")</code> debe devolver verdadero.'
|
||||||
testString: 'assert(confirmEnding("He has to give me a new name", "name") === true, "<code>confirmEnding("He has to give me a new name", "name")</code> should return true.");'
|
testString: 'assert(confirmEnding("He has to give me a new name", "name") === true, "<code>confirmEnding("He has to give me a new name", "name")</code> should return true.");'
|
||||||
- text: ' <code>confirmEnding("Open sesame", "same")</code> debe devolver verdadero.'
|
- text: ' <code>confirmEnding("Open sesame", "same")</code> debe devolver verdadero.'
|
||||||
testString: 'assert(confirmEnding("Open sesame", "same") === true, "<code>confirmEnding("Open sesame", "same")</code> should return true.");'
|
testString: 'assert(confirmEnding("Open sesame", "same") === true, "<code>confirmEnding("Open sesame", "same")</code> should return true.");'
|
||||||
- text: ' <code>confirmEnding("Open sesame", "pen")</code> debe devolver falso.
|
- text: ' <code>confirmEnding("Open sesame", "pen")</code> debe devolver falso.
|
||||||
testString: 'assert(confirmEnding("Open sesame", "pen") === false, "<code>confirmEnding("Open sesame", "pen")</code> should return false.");'
|
testString: 'assert(confirmEnding("Open sesame", "pen") === false, "<code>confirmEnding("Open sesame", "pen")</code> should return false.");'
|
||||||
- text: ' <code>confirmEnding("Open sesame", "game")</code> debe devolver falso.
|
- text: ' <code>confirmEnding("Open sesame", "game")</code> debe devolver falso.
|
||||||
testString: 'assert(confirmEnding("Open sesame", "game") === false, "<code>confirmEnding("Open sesame", "game")</code> should return false.");'
|
testString: 'assert(confirmEnding("Open sesame", "game") === false, "<code>confirmEnding("Open sesame", "game")</code> should return false.");'
|
||||||
- text: ' <code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> debería devolver el valor falso ".
|
- text: ' <code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> debería devolver el valor falso ".
|
||||||
testString: 'assert(confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") === false, "<code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> should return false.");'
|
testString: 'assert(confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain") === false, "<code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> should return false.");'
|
||||||
- text: ' <code>confirmEnding("Abstraction", "action")</code> debe devolver verdadero.'
|
- text: ' <code>confirmEnding("Abstraction", "action")</code> debe devolver verdadero.'
|
||||||
testString: 'assert(confirmEnding("Abstraction", "action") === true, "<code>confirmEnding("Abstraction", "action")</code> should return true.");'
|
testString: 'assert(confirmEnding("Abstraction", "action") === true, "<code>confirmEnding("Abstraction", "action")</code> should return true.");'
|
||||||
- text: No use el método <code>.endsWith()</code> para resolver el desafío.
|
- text: No use el método <code>.endsWith()</code> para resolver el desafío.
|
||||||
testString: 'assert(!(/\.endsWith\(.*?\)\s*?;?/.test(code)) && !(/\["endsWith"\]/.test(code)), "Do not use the built-in method <code>.endsWith()</code> to solve the challenge.");'
|
testString: 'assert(!(/\.endsWith\(.*?\)\s*?;?/.test(code)) && !(/\["endsWith"\]/.test(code)), "Do not use the built-in method <code>.endsWith()</code> to solve the challenge.");'
|
||||||
|
@ -24,13 +24,13 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>bouncer([7, "ate", "", false, 9])</code> debe devolver <code>[7, "ate", 9]</code> .'
|
- text: ' <code>bouncer([7, "ate", "", false, 9])</code> debe devolver <code>[7, "ate", 9]</code> .'
|
||||||
testString: 'assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], "<code>bouncer([7, "ate", "", false, 9])</code> should return <code>[7, "ate", 9]</code>.");'
|
testString: 'assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], "<code>bouncer([7, "ate", "", false, 9])</code> should return <code>[7, "ate", 9]</code>.");'
|
||||||
- text: ' <code>bouncer(["a", "b", "c"])</code> debe devolver <code>["a", "b", "c"]</code> .'
|
- text: ' <code>bouncer(["a", "b", "c"])</code> debe devolver <code>["a", "b", "c"]</code> .'
|
||||||
testString: 'assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], "<code>bouncer(["a", "b", "c"])</code> should return <code>["a", "b", "c"]</code>.");'
|
testString: 'assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], "<code>bouncer(["a", "b", "c"])</code> should return <code>["a", "b", "c"]</code>.");'
|
||||||
- text: ' <code>bouncer([false, null, 0, NaN, undefined, ""])</code> debe devolver <code>[]</code> .'
|
- text: ' <code>bouncer([false, null, 0, NaN, undefined, ""])</code> debe devolver <code>[]</code> .'
|
||||||
testString: 'assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], "<code>bouncer([false, null, 0, NaN, undefined, ""])</code> should return <code>[]</code>.");'
|
testString: 'assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], "<code>bouncer([false, null, 0, NaN, undefined, ""])</code> should return <code>[]</code>.");'
|
||||||
- text: ' <code>bouncer([1, null, NaN, 2, undefined])</code> debe devolver <code>[1, 2]</code> .'
|
- text: ' <code>bouncer([1, null, NaN, 2, undefined])</code> debe devolver <code>[1, 2]</code> .'
|
||||||
testString: 'assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], "<code>bouncer([1, null, NaN, 2, undefined])</code> should return <code>[1, 2]</code>.");'
|
testString: 'assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], "<code>bouncer([1, null, NaN, 2, undefined])</code> should return <code>[1, 2]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,9 +22,9 @@ Recuerda usar <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })</code> debe devolver 8.'
|
- text: ' <code>findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })</code> debe devolver 8.'
|
||||||
testString: 'assert.strictEqual(findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, "<code>findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })</code> should return 8.");'
|
testString: 'assert.strictEqual(findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }), 8, "<code>findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; })</code> should return 8.");'
|
||||||
- text: ' <code>findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> debe devolver undefined.'
|
- text: ' <code>findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> debe devolver undefined.'
|
||||||
testString: 'assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, "<code>findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> should return undefined.");'
|
testString: 'assert.strictEqual(findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; }), undefined, "<code>findElement([1, 3, 5, 9], function(num) { return num % 2 === 0; })</code> should return undefined.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -25,23 +25,23 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>mutation(["hello", "hey"])</code> debe devolver falso.'
|
- text: ' <code>mutation(["hello", "hey"])</code> debe devolver falso.'
|
||||||
testString: 'assert(mutation(["hello", "hey"]) === false, "<code>mutation(["hello", "hey"])</code> should return false.");'
|
testString: 'assert(mutation(["hello", "hey"]) === false, "<code>mutation(["hello", "hey"])</code> should return false.");'
|
||||||
- text: ' <code>mutation(["hello", "Hello"])</code> debe devolver verdadero.'
|
- text: ' <code>mutation(["hello", "Hello"])</code> debe devolver verdadero.'
|
||||||
testString: 'assert(mutation(["hello", "Hello"]) === true, "<code>mutation(["hello", "Hello"])</code> should return true.");'
|
testString: 'assert(mutation(["hello", "Hello"]) === true, "<code>mutation(["hello", "Hello"])</code> should return true.");'
|
||||||
- text: ' <code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> debe devolver verdadero.'
|
- text: ' <code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> debe devolver verdadero.'
|
||||||
testString: 'assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, "<code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> should return true.");'
|
testString: 'assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, "<code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> should return true.");'
|
||||||
- text: 'la <code>mutation(["Mary", "Army"])</code> debería devolver la verdad.'
|
- text: 'la <code>mutation(["Mary", "Army"])</code> debería devolver la verdad.'
|
||||||
testString: 'assert(mutation(["Mary", "Army"]) === true, "<code>mutation(["Mary", "Army"])</code> should return true.");'
|
testString: 'assert(mutation(["Mary", "Army"]) === true, "<code>mutation(["Mary", "Army"])</code> should return true.");'
|
||||||
- text: 'la <code>mutation(["Mary", "Aarmy"])</code> debe devolver la verdad.'
|
- text: 'la <code>mutation(["Mary", "Aarmy"])</code> debe devolver la verdad.'
|
||||||
testString: 'assert(mutation(["Mary", "Aarmy"]) === true, "<code>mutation(["Mary", "Aarmy"])</code> should return true.");'
|
testString: 'assert(mutation(["Mary", "Aarmy"]) === true, "<code>mutation(["Mary", "Aarmy"])</code> should return true.");'
|
||||||
- text: ' <code>mutation(["Alien", "line"])</code> debe devolver true.'
|
- text: ' <code>mutation(["Alien", "line"])</code> debe devolver true.'
|
||||||
testString: 'assert(mutation(["Alien", "line"]) === true, "<code>mutation(["Alien", "line"])</code> should return true.");'
|
testString: 'assert(mutation(["Alien", "line"]) === true, "<code>mutation(["Alien", "line"])</code> should return true.");'
|
||||||
- text: ' <code>mutation(["floor", "for"])</code> debe devolver verdadero.'
|
- text: ' <code>mutation(["floor", "for"])</code> debe devolver verdadero.'
|
||||||
testString: 'assert(mutation(["floor", "for"]) === true, "<code>mutation(["floor", "for"])</code> should return true.");'
|
testString: 'assert(mutation(["floor", "for"]) === true, "<code>mutation(["floor", "for"])</code> should return true.");'
|
||||||
- text: ' <code>mutation(["hello", "neo"])</code> debe devolver falso.'
|
- text: ' <code>mutation(["hello", "neo"])</code> debe devolver falso.'
|
||||||
testString: 'assert(mutation(["hello", "neo"]) === false, "<code>mutation(["hello", "neo"])</code> should return false.");'
|
testString: 'assert(mutation(["hello", "neo"]) === false, "<code>mutation(["hello", "neo"])</code> should return false.");'
|
||||||
- text: ' <code>mutation(["voodoo", "no"])</code> debe devolver falso.'
|
- text: ' <code>mutation(["voodoo", "no"])</code> debe devolver falso.'
|
||||||
testString: 'assert(mutation(["voodoo", "no"]) === false, "<code>mutation(["voodoo", "no"])</code> should return false.");'
|
testString: 'assert(mutation(["voodoo", "no"]) === false, "<code>mutation(["voodoo", "no"])</code> should return false.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,17 +22,17 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>repeatStringNumTimes("*", 3)</code> debe devolver <code>"***"</code> .'
|
- text: ' <code>repeatStringNumTimes("*", 3)</code> debe devolver <code>"***"</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("*", 3) === "***", "<code>repeatStringNumTimes("*", 3)</code> should return <code>"***"</code>.");'
|
testString: 'assert(repeatStringNumTimes("*", 3) === "***", "<code>repeatStringNumTimes("*", 3)</code> should return <code>"***"</code>.");'
|
||||||
- text: ' <code>repeatStringNumTimes("abc", 3)</code> debe devolver <code>"abcabcabc"</code> .'
|
- text: ' <code>repeatStringNumTimes("abc", 3)</code> debe devolver <code>"abcabcabc"</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("abc", 3) === "abcabcabc", "<code>repeatStringNumTimes("abc", 3)</code> should return <code>"abcabcabc"</code>.");'
|
testString: 'assert(repeatStringNumTimes("abc", 3) === "abcabcabc", "<code>repeatStringNumTimes("abc", 3)</code> should return <code>"abcabcabc"</code>.");'
|
||||||
- text: ' <code>repeatStringNumTimes("abc", 4)</code> debe devolver <code>"abcabcabcabc"</code> .'
|
- text: ' <code>repeatStringNumTimes("abc", 4)</code> debe devolver <code>"abcabcabcabc"</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("abc", 4) === "abcabcabcabc", "<code>repeatStringNumTimes("abc", 4)</code> should return <code>"abcabcabcabc"</code>.");'
|
testString: 'assert(repeatStringNumTimes("abc", 4) === "abcabcabcabc", "<code>repeatStringNumTimes("abc", 4)</code> should return <code>"abcabcabcabc"</code>.");'
|
||||||
- text: ' <code>repeatStringNumTimes("abc", 1)</code> debe devolver <code>"abc"</code> .'
|
- text: ' <code>repeatStringNumTimes("abc", 1)</code> debe devolver <code>"abc"</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("abc", 1) === "abc", "<code>repeatStringNumTimes("abc", 1)</code> should return <code>"abc"</code>.");'
|
testString: 'assert(repeatStringNumTimes("abc", 1) === "abc", "<code>repeatStringNumTimes("abc", 1)</code> should return <code>"abc"</code>.");'
|
||||||
- text: ' <code>repeatStringNumTimes("*", 8)</code> debe devolver <code>"********"</code> .'
|
- text: ' <code>repeatStringNumTimes("*", 8)</code> debe devolver <code>"********"</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("*", 8) === "********", "<code>repeatStringNumTimes("*", 8)</code> should return <code>"********"</code>.");'
|
testString: 'assert(repeatStringNumTimes("*", 8) === "********", "<code>repeatStringNumTimes("*", 8)</code> should return <code>"********"</code>.");'
|
||||||
- text: ' <code>repeatStringNumTimes("abc", -2)</code> debe devolver <code>""</code> .'
|
- text: ' <code>repeatStringNumTimes("abc", -2)</code> debe devolver <code>""</code> .'
|
||||||
testString: 'assert(repeatStringNumTimes("abc", -2) === "", "<code>repeatStringNumTimes("abc", -2)</code> should return <code>""</code>.");'
|
testString: 'assert(repeatStringNumTimes("abc", -2) === "", "<code>repeatStringNumTimes("abc", -2)</code> should return <code>""</code>.");'
|
||||||
- text: El método <code>repeat()</code> incorporado no debe utilizarse
|
- text: El método <code>repeat()</code> incorporado no debe utilizarse
|
||||||
testString: 'assert(!/\.repeat/g.test(code), "The built-in <code>repeat()</code>-method should not be used");'
|
testString: 'assert(!/\.repeat/g.test(code), "The built-in <code>repeat()</code>-method should not be used");'
|
||||||
|
@ -23,13 +23,13 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> debe devolver una matriz. '
|
- text: ' <code>largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> debe devolver una matriz. '
|
||||||
testString: 'assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, "<code>largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return an array.");'
|
testString: 'assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, "<code>largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return an array.");'
|
||||||
- text: ' <code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> debe devolver <code>[27, 5, 39, 1001]</code> .
|
- text: ' <code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> debe devolver <code>[27, 5, 39, 1001]</code> .
|
||||||
testString: 'assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27, 5, 39, 1001], "<code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return <code>[27, 5, 39, 1001]</code>.");'
|
testString: 'assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27, 5, 39, 1001], "<code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return <code>[27, 5, 39, 1001]</code>.");'
|
||||||
- text: ' <code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> debe devolver <code>[9, 35, 97, 1000000]</code> .
|
- text: ' <code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> debe devolver <code>[9, 35, 97, 1000000]</code> .
|
||||||
testString: 'assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9, 35, 97, 1000000], "<code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> should return <code>[9, 35, 97, 1000000]</code>.");'
|
testString: 'assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9, 35, 97, 1000000], "<code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> should return <code>[9, 35, 97, 1000000]</code>.");'
|
||||||
- text: ' <code>largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])</code> debe devolver <code>[25, 48, 21, -3]</code> . '
|
- text: ' <code>largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])</code> debe devolver <code>[25, 48, 21, -3]</code> . '
|
||||||
testString: 'assert.deepEqual(largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]), [25, 48, 21, -3], "<code>largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])</code> should return <code>[25, 48, 21, -3]</code>.");'
|
testString: 'assert.deepEqual(largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]), [25, 48, 21, -3], "<code>largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])</code> should return <code>[25, 48, 21, -3]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,11 +26,11 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>frankenSplice([1, 2, 3], [4, 5], 1)</code> debe devolver <code>[4, 1, 2, 3, 5]</code> .'
|
- text: ' <code>frankenSplice([1, 2, 3], [4, 5], 1)</code> debe devolver <code>[4, 1, 2, 3, 5]</code> .'
|
||||||
testString: 'assert.deepEqual(frankenSplice([1, 2, 3], [4, 5], 1), [4, 1, 2, 3, 5], "<code>frankenSplice([1, 2, 3], [4, 5], 1)</code> should return <code>[4, 1, 2, 3, 5]</code>.");'
|
testString: 'assert.deepEqual(frankenSplice([1, 2, 3], [4, 5], 1), [4, 1, 2, 3, 5], "<code>frankenSplice([1, 2, 3], [4, 5], 1)</code> should return <code>[4, 1, 2, 3, 5]</code>.");'
|
||||||
- text: ' <code>frankenSplice([1, 2], ["a", "b"], 1)</code> debe devolver <code>["a", 1, 2, "b"]</code> .'
|
- text: ' <code>frankenSplice([1, 2], ["a", "b"], 1)</code> debe devolver <code>["a", 1, 2, "b"]</code> .'
|
||||||
testString: 'assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"], "<code>frankenSplice([1, 2], ["a", "b"], 1)</code> should return <code>["a", 1, 2, "b"]</code>.");'
|
testString: 'assert.deepEqual(frankenSplice(testArr1, testArr2, 1), ["a", 1, 2, "b"], "<code>frankenSplice([1, 2], ["a", "b"], 1)</code> should return <code>["a", 1, 2, "b"]</code>.");'
|
||||||
- text: ' <code>frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)</code> debe devolver <code>["head", "shoulders", "claw", "tentacle", "knees", "toes"]</code> . '
|
- text: ' <code>frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)</code> debe devolver <code>["head", "shoulders", "claw", "tentacle", "knees", "toes"]</code> . '
|
||||||
testString: 'assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"], "<code>frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)</code> should return <code>["head", "shoulders", "claw", "tentacle", "knees", "toes"]</code>.");'
|
testString: 'assert.deepEqual(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2), ["head", "shoulders", "claw", "tentacle", "knees", "toes"], "<code>frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)</code> should return <code>["head", "shoulders", "claw", "tentacle", "knees", "toes"]</code>.");'
|
||||||
- text: Todos los elementos de la primera matriz se deben agregar a la segunda matriz en su orden original.
|
- text: Todos los elementos de la primera matriz se deben agregar a la segunda matriz en su orden original.
|
||||||
testString: 'assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4], "All elements from the first array should be added to the second array in their original order.");'
|
testString: 'assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4], "All elements from the first array should be added to the second array in their original order.");'
|
||||||
|
@ -23,9 +23,9 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>titleCase("I'm a little tea pot")</code> debería devolver una cadena.'
|
- text: ' <code>titleCase("I'm a little tea pot")</code> debería devolver una cadena.'
|
||||||
testString: 'assert(typeof titleCase("I"m a little tea pot") === "string", "<code>titleCase("I'm a little tea pot")</code> should return a string.");'
|
testString: 'assert(typeof titleCase("I"m a little tea pot") === "string", "<code>titleCase("I'm a little tea pot")</code> should return a string.");'
|
||||||
- text: ' <code>titleCase("I'm a little tea pot")</code> debería devolver <code>I'm A Little Tea Pot</code> '.
|
- text: ' <code>titleCase("I'm a little tea pot")</code> debería devolver <code>I'm A Little Tea Pot</code> '
|
||||||
testString: 'assert(titleCase("I"m a little tea pot") === "I"m A Little Tea Pot", "<code>titleCase("I'm a little tea pot")</code> should return <code>I'm A Little Tea Pot</code>.");'
|
testString: 'assert(titleCase("I"m a little tea pot") === "I"m A Little Tea Pot", "<code>titleCase("I'm a little tea pot")</code> should return <code>I'm A Little Tea Pot</code>.");'
|
||||||
- text: <code>titleCase("sHoRt AnD sToUt")</code> debe devolver <code>Short And Stout</code> .
|
- text: <code>titleCase("sHoRt AnD sToUt")</code> debe devolver <code>Short And Stout</code> .
|
||||||
testString: 'assert(titleCase("sHoRt AnD sToUt") === "Short And Stout", "<code>titleCase("sHoRt AnD sToUt")</code> should return <code>Short And Stout</code>.");'
|
testString: 'assert(titleCase("sHoRt AnD sToUt") === "Short And Stout", "<code>titleCase("sHoRt AnD sToUt")</code> should return <code>Short And Stout</code>.");'
|
||||||
|
@ -22,17 +22,17 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", 8)</code> debe devolver "A-tisket ...".'
|
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", 8)</code> debe devolver "A-tisket ...".'
|
||||||
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", 8) === "A-tisket...", "<code>truncateString("A-tisket a-tasket A green and yellow basket", 8)</code> should return "A-tisket...".");'
|
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", 8) === "A-tisket...", "<code>truncateString("A-tisket a-tasket A green and yellow basket", 8)</code> should return "A-tisket...".");'
|
||||||
- text: ' <code>truncateString("Peter Piper picked a peck of pickled peppers", 11)</code> debería devolver "Peter Piper ...".
|
- text: ' <code>truncateString("Peter Piper picked a peck of pickled peppers", 11)</code> debería devolver "Peter Piper ...".
|
||||||
testString: 'assert(truncateString("Peter Piper picked a peck of pickled peppers", 11) === "Peter Piper...", "<code>truncateString("Peter Piper picked a peck of pickled peppers", 11)</code> should return "Peter Piper...".");'
|
testString: 'assert(truncateString("Peter Piper picked a peck of pickled peppers", 11) === "Peter Piper...", "<code>truncateString("Peter Piper picked a peck of pickled peppers", 11)</code> should return "Peter Piper...".");'
|
||||||
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)</code> debe devolver "A-tisket a-tasket Una canasta verde y amarilla".'
|
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)</code> debe devolver "A-tisket a-tasket Una canasta verde y amarilla".'
|
||||||
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) === "A-tisket a-tasket A green and yellow basket", "<code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)</code> should return "A-tisket a-tasket A green and yellow basket".");'
|
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) === "A-tisket a-tasket A green and yellow basket", "<code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length)</code> should return "A-tisket a-tasket A green and yellow basket".");'
|
||||||
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)</code> debe devolver "A-tisket a-tasket Una canasta verde y amarilla" .
|
- text: ' <code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)</code> debe devolver "A-tisket a-tasket Una canasta verde y amarilla" .
|
||||||
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) === "A-tisket a-tasket A green and yellow basket", "<code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)</code> should return "A-tisket a-tasket A green and yellow basket".");'
|
testString: 'assert(truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) === "A-tisket a-tasket A green and yellow basket", "<code>truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2)</code> should return "A-tisket a-tasket A green and yellow basket".");'
|
||||||
- text: ' <code>truncateString("A-", 1)</code> debe devolver "A ...".'
|
- text: ' <code>truncateString("A-", 1)</code> debe devolver "A ...".'
|
||||||
testString: 'assert(truncateString("A-", 1) === "A...", "<code>truncateString("A-", 1)</code> should return "A...".");'
|
testString: 'assert(truncateString("A-", 1) === "A...", "<code>truncateString("A-", 1)</code> should return "A...".");'
|
||||||
- text: ' <code>truncateString("Absolutely Longer", 2)</code> debe devolver "Ab ...".'
|
- text: ' <code>truncateString("Absolutely Longer", 2)</code> debe devolver "Ab ...".'
|
||||||
testString: 'assert(truncateString("Absolutely Longer", 2) === "Ab...", "<code>truncateString("Absolutely Longer", 2)</code> should return "Ab...".");'
|
testString: 'assert(truncateString("Absolutely Longer", 2) === "Ab...", "<code>truncateString("Absolutely Longer", 2)</code> should return "Ab...".");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,37 +24,37 @@ Recuerda usar <a href="http://forum.freecodecamp.org/t/how-to-get-help-when-you-
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> debe devolver <code>3</code> '
|
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> debe devolver <code>3</code> '
|
||||||
testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3, "<code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.");'
|
testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3, "<code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.");'
|
||||||
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 35)) === "number", "<code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 35)) === "number", "<code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> debe devolver <code>2</code> '
|
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> debe devolver <code>2</code> '
|
||||||
testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, "<code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.");'
|
testString: 'assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, "<code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.");'
|
||||||
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 30)) === "number", "<code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([10, 20, 30, 40, 50], 30)) === "number", "<code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([40, 60], 50)</code> debe devolver <code>1</code> '
|
- text: ' <code>getIndexToIns([40, 60], 50)</code> debe devolver <code>1</code> '
|
||||||
testString: 'assert(getIndexToIns([40, 60], 50) === 1, "<code>getIndexToIns([40, 60], 50)</code> should return <code>1</code>.");'
|
testString: 'assert(getIndexToIns([40, 60], 50) === 1, "<code>getIndexToIns([40, 60], 50)</code> should return <code>1</code>.");'
|
||||||
- text: ' <code>getIndexToIns([40, 60], 50)</code> debe devolver un número.'
|
- text: ' <code>getIndexToIns([40, 60], 50)</code> debe devolver un número.'
|
||||||
testString: 'assert(typeof(getIndexToIns([40, 60], 50)) === "number", "<code>getIndexToIns([40, 60], 50)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([40, 60], 50)) === "number", "<code>getIndexToIns([40, 60], 50)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([3, 10, 5], 3)</code> debe devolver <code>0</code> '
|
- text: ' <code>getIndexToIns([3, 10, 5], 3)</code> debe devolver <code>0</code> '
|
||||||
testString: 'assert(getIndexToIns([3, 10, 5], 3) === 0, "<code>getIndexToIns([3, 10, 5], 3)</code> should return <code>0</code>.");'
|
testString: 'assert(getIndexToIns([3, 10, 5], 3) === 0, "<code>getIndexToIns([3, 10, 5], 3)</code> should return <code>0</code>.");'
|
||||||
- text: ' <code>getIndexToIns([3, 10, 5], 3)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([3, 10, 5], 3)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([3, 10, 5], 3)) === "number", "<code>getIndexToIns([3, 10, 5], 3)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([3, 10, 5], 3)) === "number", "<code>getIndexToIns([3, 10, 5], 3)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([5, 3, 20, 3], 5)</code> debe devolver <code>2</code> '
|
- text: ' <code>getIndexToIns([5, 3, 20, 3], 5)</code> debe devolver <code>2</code> '
|
||||||
testString: 'assert(getIndexToIns([5, 3, 20, 3], 5) === 2, "<code>getIndexToIns([5, 3, 20, 3], 5)</code> should return <code>2</code>.");'
|
testString: 'assert(getIndexToIns([5, 3, 20, 3], 5) === 2, "<code>getIndexToIns([5, 3, 20, 3], 5)</code> should return <code>2</code>.");'
|
||||||
- text: ' <code>getIndexToIns([5, 3, 20, 3], 5)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([5, 3, 20, 3], 5)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([5, 3, 20, 3], 5)) === "number", "<code>getIndexToIns([5, 3, 20, 3], 5)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([5, 3, 20, 3], 5)) === "number", "<code>getIndexToIns([5, 3, 20, 3], 5)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([2, 20, 10], 19)</code> debe devolver <code>2</code> '
|
- text: ' <code>getIndexToIns([2, 20, 10], 19)</code> debe devolver <code>2</code> '
|
||||||
testString: 'assert(getIndexToIns([2, 20, 10], 19) === 2, "<code>getIndexToIns([2, 20, 10], 19)</code> should return <code>2</code>.");'
|
testString: 'assert(getIndexToIns([2, 20, 10], 19) === 2, "<code>getIndexToIns([2, 20, 10], 19)</code> should return <code>2</code>.");'
|
||||||
- text: ' <code>getIndexToIns([2, 20, 10], 19)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([2, 20, 10], 19)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([2, 20, 10], 19)) === "number", "<code>getIndexToIns([2, 20, 10], 19)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([2, 20, 10], 19)) === "number", "<code>getIndexToIns([2, 20, 10], 19)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([2, 5, 10], 15)</code> debe devolver <code>3</code> '
|
- text: ' <code>getIndexToIns([2, 5, 10], 15)</code> debe devolver <code>3</code> '
|
||||||
testString: 'assert(getIndexToIns([2, 5, 10], 15) === 3, "<code>getIndexToIns([2, 5, 10], 15)</code> should return <code>3</code>.");'
|
testString: 'assert(getIndexToIns([2, 5, 10], 15) === 3, "<code>getIndexToIns([2, 5, 10], 15)</code> should return <code>3</code>.");'
|
||||||
- text: ' <code>getIndexToIns([2, 5, 10], 15)</code> debe devolver un número'.
|
- text: ' <code>getIndexToIns([2, 5, 10], 15)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof(getIndexToIns([2, 5, 10], 15)) === "number", "<code>getIndexToIns([2, 5, 10], 15)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([2, 5, 10], 15)) === "number", "<code>getIndexToIns([2, 5, 10], 15)</code> should return a number.");'
|
||||||
- text: ' <code>getIndexToIns([], 1)</code> debe devolver <code>0</code> '
|
- text: ' <code>getIndexToIns([], 1)</code> debe devolver <code>0</code> '
|
||||||
testString: 'assert(getIndexToIns([], 1) === 0, "<code>getIndexToIns([], 1)</code> should return <code>0</code>.");'
|
testString: 'assert(getIndexToIns([], 1) === 0, "<code>getIndexToIns([], 1)</code> should return <code>0</code>.");'
|
||||||
- text: ' <code>getIndexToIns([], 1)</code> debe devolver un número.'
|
- text: ' <code>getIndexToIns([], 1)</code> debe devolver un número.'
|
||||||
testString: 'assert(typeof(getIndexToIns([], 1)) === "number", "<code>getIndexToIns([], 1)</code> should return a number.");'
|
testString: 'assert(typeof(getIndexToIns([], 1)) === "number", "<code>getIndexToIns([], 1)</code> should return a number.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -29,13 +29,13 @@ Para completar este desafío, establezca la segunda posición (índice <code>1</
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray[0]</code> es igual a <code>"a"</code> '
|
- text: ' <code>myArray[0]</code> es igual a <code>"a"</code> '
|
||||||
testString: 'assert.strictEqual(myArray[0], "a", "<code>myArray[0]</code> is equal to <code>"a"</code>");'
|
testString: 'assert.strictEqual(myArray[0], "a", "<code>myArray[0]</code> is equal to <code>"a"</code>");'
|
||||||
- text: ' <code>myArray[1]</code> ya no está configurado en <code>"b"</code> '
|
- text: ' <code>myArray[1]</code> ya no está configurado en <code>"b"</code> '
|
||||||
testString: 'assert.notStrictEqual(myArray[1], "b", "<code>myArray[1]</code> is no longer set to <code>"b"</code>");'
|
testString: 'assert.notStrictEqual(myArray[1], "b", "<code>myArray[1]</code> is no longer set to <code>"b"</code>");'
|
||||||
- text: ' <code>myArray[2]</code> es igual a <code>"c"</code> '
|
- text: ' <code>myArray[2]</code> es igual a <code>"c"</code> '
|
||||||
testString: 'assert.strictEqual(myArray[2], "c", "<code>myArray[2]</code> is equal to <code>"c"</code>");'
|
testString: 'assert.strictEqual(myArray[2], "c", "<code>myArray[2]</code> is equal to <code>"c"</code>");'
|
||||||
- text: ' <code>myArray[3]</code> es igual a <code>"d"</code> '
|
- text: ' <code>myArray[3]</code> es igual a <code>"d"</code> '
|
||||||
testString: 'assert.strictEqual(myArray[3], "d", "<code>myArray[3]</code> is equal to <code>"d"</code>");'
|
testString: 'assert.strictEqual(myArray[3], "d", "<code>myArray[3]</code> is equal to <code>"d"</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ Hemos definido una función, <code>checkInventory</code> , que recibe un element
|
|||||||
tests:
|
tests:
|
||||||
- text: <code>checkInventory</code> es una función
|
- text: <code>checkInventory</code> es una función
|
||||||
testString: 'assert.strictEqual(typeof checkInventory, "function", "<code>checkInventory</code> is a function");'
|
testString: 'assert.strictEqual(typeof checkInventory, "function", "<code>checkInventory</code> is a function");'
|
||||||
- text: 'El objeto de <code>foods</code> debe tener solo los siguientes pares clave-valor: <code>apples: 25</code> , <code>oranges: 32</code> , <code>plums: 28</code> , <code>bananas: 13</code> , <code>grapes: 35</code> , <code>strawberries: 27</code> '
|
- text: 'El objeto de <code>foods</code> debe tener solo los siguientes pares clave-valor: <code>apples: 25</code> , <code>oranges: 32</code> , <code>plums: 28</code> , <code>bananas: 13</code> , <code>grapes: 35</code> , <code>strawberries: 27</code> '
|
||||||
testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27}, "The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>");'
|
testString: 'assert.deepEqual(foods, {apples: 25, oranges: 32, plums: 28, bananas: 13, grapes: 35, strawberries: 27}, "The <code>foods</code> object should have only the following key-value pairs: <code>apples: 25</code>, <code>oranges: 32</code>, <code>plums: 28</code>, <code>bananas: 13</code>, <code>grapes: 35</code>, <code>strawberries: 27</code>");'
|
||||||
- text: <code>checkInventory("apples")</code> debe devolver <code>25</code>
|
- text: <code>checkInventory("apples")</code> debe devolver <code>25</code>
|
||||||
testString: 'assert.strictEqual(checkInventory("apples"), 25, "<code>checkInventory("apples")</code> should return <code>25</code>");'
|
testString: 'assert.strictEqual(checkInventory("apples"), 25, "<code>checkInventory("apples")</code> should return <code>25</code>");'
|
||||||
|
@ -23,7 +23,7 @@ Hemos definido una función, <code>mixedNumbers</code> , a la que le estamos pas
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>mixedNumbers(["IV", 5, "six"])</code> ahora debe devolver <code>["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]</code> '
|
- text: ' <code>mixedNumbers(["IV", 5, "six"])</code> ahora debe devolver <code>["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]</code> '
|
||||||
testString: 'assert.deepEqual(mixedNumbers(["IV", 5, "six"]), ["I", 2, "three", "IV", 5, "six", 7, "VIII", 9], "<code>mixedNumbers(["IV", 5, "six"])</code> should now return <code>["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]</code>");'
|
testString: 'assert.deepEqual(mixedNumbers(["IV", 5, "six"]), ["I", 2, "three", "IV", 5, "six", 7, "VIII", 9], "<code>mixedNumbers(["IV", 5, "six"])</code> should now return <code>["I", 2, "three", "IV", 5, "six", 7, "VIII", 9]</code>");'
|
||||||
- text: La función <code>mixedNumbers</code> debe utilizar el método <code>push()</code>
|
- text: La función <code>mixedNumbers</code> debe utilizar el método <code>push()</code>
|
||||||
testString: 'assert.notStrictEqual(mixedNumbers.toString().search(/\.push\(/), -1, "The <code>mixedNumbers</code> function should utilize the <code>push()</code> method");'
|
testString: 'assert.notStrictEqual(mixedNumbers.toString().search(/\.push\(/), -1, "The <code>mixedNumbers</code> function should utilize the <code>push()</code> method");'
|
||||||
|
@ -22,7 +22,7 @@ Hemos definido una función, <code>htmlColorNames</code> , que toma una matriz d
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>htmlColorNames</code> debería devolver <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code> '
|
- text: ' <code>htmlColorNames</code> debería devolver <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code> '
|
||||||
testString: 'assert.deepEqual(htmlColorNames(["DarkGoldenRod", "WhiteSmoke", "LavenderBlush", "PaleTurqoise", "FireBrick"]), ["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"], "<code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code>");'
|
testString: 'assert.deepEqual(htmlColorNames(["DarkGoldenRod", "WhiteSmoke", "LavenderBlush", "PaleTurqoise", "FireBrick"]), ["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"], "<code>htmlColorNames</code> should return <code>["DarkSalmon", "BlanchedAlmond", "LavenderBlush", "PaleTurqoise", "FireBrick"]</code>");'
|
||||||
- text: La función <code>htmlColorNames</code> debe utilizar el método <code>splice()</code>
|
- text: La función <code>htmlColorNames</code> debe utilizar el método <code>splice()</code>
|
||||||
testString: 'assert(/.splice/.test(code), "The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method");'
|
testString: 'assert(/.splice/.test(code), "The <code>htmlColorNames</code> function should utilize the <code>splice()</code> method");'
|
||||||
|
@ -22,13 +22,13 @@ Por ejemplo:
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>quickCheck(["squash", "onions", "shallots"], "mushrooms")</code> debe devolver <code>false</code> '
|
- text: ' <code>quickCheck(["squash", "onions", "shallots"], "mushrooms")</code> debe devolver <code>false</code> '
|
||||||
testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "mushrooms"), false, "<code>quickCheck(["squash", "onions", "shallots"], "mushrooms")</code> should return <code>false</code>");'
|
testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "mushrooms"), false, "<code>quickCheck(["squash", "onions", "shallots"], "mushrooms")</code> should return <code>false</code>");'
|
||||||
- text: ' <code>quickCheck(["squash", "onions", "shallots"], "onions")</code> debe devolver <code>true</code> "
|
- text: ' <code>quickCheck(["squash", "onions", "shallots"], "onions")</code> debe devolver <code>true</code> "
|
||||||
testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "onions"), true, "<code>quickCheck(["squash", "onions", "shallots"], "onions")</code> should return <code>true</code>");'
|
testString: 'assert.strictEqual(quickCheck(["squash", "onions", "shallots"], "onions"), true, "<code>quickCheck(["squash", "onions", "shallots"], "onions")</code> should return <code>true</code>");'
|
||||||
- text: ' <code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> debe devolver <code>true</code> '
|
- text: ' <code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> debe devolver <code>true</code> '
|
||||||
testString: 'assert.strictEqual(quickCheck([3, 5, 9, 125, 45, 2], 125), true, "<code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> should return <code>true</code>");'
|
testString: 'assert.strictEqual(quickCheck([3, 5, 9, 125, 45, 2], 125), true, "<code>quickCheck([3, 5, 9, 125, 45, 2], 125)</code> should return <code>true</code>");'
|
||||||
- text: ' <code>quickCheck([true, false, false], undefined)</code> debe devolver <code>false</code> '
|
- text: ' <code>quickCheck([true, false, false], undefined)</code> debe devolver <code>false</code> '
|
||||||
testString: 'assert.strictEqual(quickCheck([true, false, false], undefined), false, "<code>quickCheck([true, false, false], undefined)</code> should return <code>false</code>");'
|
testString: 'assert.strictEqual(quickCheck([true, false, false], undefined), false, "<code>quickCheck([true, false, false], undefined)</code> should return <code>false</code>");'
|
||||||
- text: La función <code>quickCheck</code> debe utilizar el método <code>indexOf()</code>
|
- text: La función <code>quickCheck</code> debe utilizar el método <code>indexOf()</code>
|
||||||
testString: 'assert.notStrictEqual(quickCheck.toString().search(/\.indexOf\(/), -1, "The <code>quickCheck</code> function should utilize the <code>indexOf()</code> method");'
|
testString: 'assert.notStrictEqual(quickCheck.toString().search(/\.indexOf\(/), -1, "The <code>quickCheck</code> function should utilize the <code>indexOf()</code> method");'
|
||||||
|
@ -21,11 +21,11 @@ Hemos creado un objeto, <code>users</code> , con algunos usuarios en él y una f
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El objeto de los <code>users</code> solo contiene las claves <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> '
|
- text: 'El objeto de los <code>users</code> solo contiene las claves <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> '
|
||||||
testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>");'
|
testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>");'
|
||||||
- text: 'La función <code>isEveryoneHere</code> devuelve <code>true</code> si <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> son propiedades del objeto de los <code>users</code> '
|
- text: 'La función <code>isEveryoneHere</code> devuelve <code>true</code> si <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> son propiedades del objeto de los <code>users</code> '
|
||||||
testString: 'assert(isEveryoneHere(users) === true, "The function <code>isEveryoneHere</code> returns <code>true</code> if <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code> are properties on the <code>users</code> object");'
|
testString: 'assert(isEveryoneHere(users) === true, "The function <code>isEveryoneHere</code> returns <code>true</code> if <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code> are properties on the <code>users</code> object");'
|
||||||
- text: 'La función <code>isEveryoneHere</code> devuelve <code>false</code> si <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> no son propiedades del objeto de los <code>users</code> '
|
- text: 'La función <code>isEveryoneHere</code> devuelve <code>false</code> si <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> no son propiedades del objeto de los <code>users</code> '
|
||||||
testString: 'assert((function() { delete users.Alan; delete users.Jeff; delete users.Sarah; delete users.Ryan; return isEveryoneHere(users) })() === false, "The function <code>isEveryoneHere</code> returns <code>false</code> if <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code> are not properties on the <code>users</code> object");'
|
testString: 'assert((function() { delete users.Alan; delete users.Jeff; delete users.Sarah; delete users.Ryan; return isEveryoneHere(users) })() === false, "The function <code>isEveryoneHere</code> returns <code>false</code> if <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code> are not properties on the <code>users</code> object");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,7 +22,7 @@ Hemos definido una función <code>spreadOut</code> que devuelve la <code>sentenc
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>spreadOut</code> debería devolver <code>["learning", "to", "code", "is", "fun"]</code> '
|
- text: ' <code>spreadOut</code> debería devolver <code>["learning", "to", "code", "is", "fun"]</code> '
|
||||||
testString: 'assert.deepEqual(spreadOut(), ["learning", "to", "code", "is", "fun"], "<code>spreadOut</code> should return <code>["learning", "to", "code", "is", "fun"]</code>");'
|
testString: 'assert.deepEqual(spreadOut(), ["learning", "to", "code", "is", "fun"], "<code>spreadOut</code> should return <code>["learning", "to", "code", "is", "fun"]</code>");'
|
||||||
- text: La función <code>spreadOut</code> debe utilizar la sintaxis de difusión
|
- text: La función <code>spreadOut</code> debe utilizar la sintaxis de difusión
|
||||||
testString: 'assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, "The <code>spreadOut</code> function should utilize spread syntax");'
|
testString: 'assert.notStrictEqual(spreadOut.toString().search(/[...]/), -1, "The <code>spreadOut</code> function should utilize spread syntax");'
|
||||||
|
@ -22,13 +22,13 @@ Hemos definido una función, <code>copyMachine</code> que toma <code>arr</code>
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>copyMachine([true, false, true], 2)</code> debe devolver <code>[[true, false, true], [true, false, true]]</code> '
|
- text: ' <code>copyMachine([true, false, true], 2)</code> debe devolver <code>[[true, false, true], [true, false, true]]</code> '
|
||||||
testString: 'assert.deepEqual(copyMachine([true, false, true], 2), [[true, false, true], [true, false, true]], "<code>copyMachine([true, false, true], 2)</code> should return <code>[[true, false, true], [true, false, true]]</code>");'
|
testString: 'assert.deepEqual(copyMachine([true, false, true], 2), [[true, false, true], [true, false, true]], "<code>copyMachine([true, false, true], 2)</code> should return <code>[[true, false, true], [true, false, true]]</code>");'
|
||||||
- text: ' <code>copyMachine([1, 2, 3], 5)</code> debe devolver <code>[[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]</code> '
|
- text: ' <code>copyMachine([1, 2, 3], 5)</code> debe devolver <code>[[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]</code> '
|
||||||
testString: 'assert.deepEqual(copyMachine([1, 2, 3], 5), [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]], "<code>copyMachine([1, 2, 3], 5)</code> should return <code>[[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]</code>");'
|
testString: 'assert.deepEqual(copyMachine([1, 2, 3], 5), [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]], "<code>copyMachine([1, 2, 3], 5)</code> should return <code>[[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]</code>");'
|
||||||
- text: ' <code>copyMachine([true, true, null], 1)</code> debe devolver <code>[[true, true, null]]</code> '
|
- text: ' <code>copyMachine([true, true, null], 1)</code> debe devolver <code>[[true, true, null]]</code> '
|
||||||
testString: 'assert.deepEqual(copyMachine([true, true, null], 1), [[true, true, null]], "<code>copyMachine([true, true, null], 1)</code> should return <code>[[true, true, null]]</code>");'
|
testString: 'assert.deepEqual(copyMachine([true, true, null], 1), [[true, true, null]], "<code>copyMachine([true, true, null], 1)</code> should return <code>[[true, true, null]]</code>");'
|
||||||
- text: ' <code>copyMachine(["it works"], 3)</code> debería devolver <code>[["it works"], ["it works"], ["it works"]]</code> '
|
- text: ' <code>copyMachine(["it works"], 3)</code> debería devolver <code>[["it works"], ["it works"], ["it works"]]</code> '
|
||||||
testString: 'assert.deepEqual(copyMachine(["it works"], 3), [["it works"], ["it works"], ["it works"]], "<code>copyMachine(["it works"], 3)</code> should return <code>[["it works"], ["it works"], ["it works"]]</code>");'
|
testString: 'assert.deepEqual(copyMachine(["it works"], 3), [["it works"], ["it works"], ["it works"]], "<code>copyMachine(["it works"], 3)</code> should return <code>[["it works"], ["it works"], ["it works"]]</code>");'
|
||||||
- text: La función <code>copyMachine</code> debe utilizar el <code>spread operator</code> con array <code>arr</code>
|
- text: La función <code>copyMachine</code> debe utilizar el <code>spread operator</code> con array <code>arr</code>
|
||||||
testString: 'assert.notStrictEqual(copyMachine.toString().indexOf(".concat(_toConsumableArray(arr))"), -1, "The <code>copyMachine</code> function should utilize the <code>spread operator</code> with array <code>arr</code>");'
|
testString: 'assert.notStrictEqual(copyMachine.toString().indexOf(".concat(_toConsumableArray(arr))"), -1, "The <code>copyMachine</code> function should utilize the <code>spread operator</code> with array <code>arr</code>");'
|
||||||
|
@ -22,7 +22,7 @@ Hemos definido una función, <code>forecast</code> , que toma una matriz como ar
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>forecast</code> debería devolver <code>["warm", "sunny"]'</code>
|
- text: ' <code>forecast</code> debería devolver <code>["warm", "sunny"]'</code>
|
||||||
testString: 'assert.deepEqual(forecast(["cold", "rainy", "warm", "sunny", "cool", "thunderstorms"]), ["warm", "sunny"], "<code>forecast</code> should return <code>["warm", "sunny"]");'
|
testString: 'assert.deepEqual(forecast(["cold", "rainy", "warm", "sunny", "cool", "thunderstorms"]), ["warm", "sunny"], "<code>forecast</code> should return <code>["warm", "sunny"]");'
|
||||||
- text: La función de <code>forecast</code> debe utilizar el método <code>slice()</code>
|
- text: La función de <code>forecast</code> debe utilizar el método <code>slice()</code>
|
||||||
testString: 'assert(/\.slice\(/.test(code), "The <code>forecast</code> function should utilize the <code>slice()</code> method");'
|
testString: 'assert(/\.slice\(/.test(code), "The <code>forecast</code> function should utilize the <code>slice()</code> method");'
|
||||||
|
@ -27,7 +27,7 @@ Hemos definido una variable, <code>myNestedArray</code> , igual a una matriz. Mo
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myNestedArray</code> debe contener solo números, booleanos y cadenas como elementos de datos'
|
- text: ' <code>myNestedArray</code> debe contener solo números, booleanos y cadenas como elementos de datos'
|
||||||
testString: 'assert.strictEqual((function(arr) { let flattened = (function flatten(arr) { const flat = [].concat(...arr); return flat.some (Array.isArray) ? flatten(flat) : flat; })(arr); for (let i = 0; i < flattened.length; i++) { if ( typeof flattened[i] !== "number" && typeof flattened[i] !== "string" && typeof flattened[i] !== "boolean") { return false } } return true })(myNestedArray), true, "<code>myNestedArray</code> should contain only numbers, booleans, and strings as data elements");'
|
testString: 'assert.strictEqual((function(arr) { let flattened = (function flatten(arr) { const flat = [].concat(...arr); return flat.some (Array.isArray) ? flatten(flat) : flat; })(arr); for (let i = 0; i < flattened.length; i++) { if ( typeof flattened[i] !== "number" && typeof flattened[i] !== "string" && typeof flattened[i] !== "boolean") { return false } } return true })(myNestedArray), true, "<code>myNestedArray</code> should contain only numbers, booleans, and strings as data elements");'
|
||||||
- text: <code>myNestedArray</code> debe tener exactamente 5 niveles de profundidad
|
- text: <code>myNestedArray</code> debe tener exactamente 5 niveles de profundidad
|
||||||
testString: 'assert.strictEqual((function(arr) {let depth = 0;function arrayDepth(array, i, d) { if (Array.isArray(array[i])) { arrayDepth(array[i], 0, d + 1);} else { depth = (d > depth) ? d : depth;}if (i < array.length) { arrayDepth(array, i + 1, d);} }arrayDepth(arr, 0, 0);return depth;})(myNestedArray), 4, "<code>myNestedArray</code> should have exactly 5 levels of depth");'
|
testString: 'assert.strictEqual((function(arr) {let depth = 0;function arrayDepth(array, i, d) { if (Array.isArray(array[i])) { arrayDepth(array[i], 0, d + 1);} else { depth = (d > depth) ? d : depth;}if (i < array.length) { arrayDepth(array, i + 1, d);} }arrayDepth(arr, 0, 0);return depth;})(myNestedArray), 4, "<code>myNestedArray</code> should have exactly 5 levels of depth");'
|
||||||
|
@ -20,7 +20,7 @@ Termine de escribir la función <code>getArrayOfUsers</code> para que devuelva u
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El objeto de los <code>users</code> solo contiene las claves <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> '
|
- text: 'El objeto de los <code>users</code> solo contiene las claves <code>Alan</code> , <code>Jeff</code> , <code>Sarah</code> y <code>Ryan</code> '
|
||||||
testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>");'
|
testString: 'assert("Alan" in users && "Jeff" in users && "Sarah" in users && "Ryan" in users && Object.keys(users).length === 4, "The <code>users</code> object only contains the keys <code>Alan</code>, <code>Jeff</code>, <code>Sarah</code>, and <code>Ryan</code>");'
|
||||||
- text: La función <code>getArrayOfUsers</code> devuelve una matriz que contiene todas las claves en el objeto de los <code>users</code>
|
- text: La función <code>getArrayOfUsers</code> devuelve una matriz que contiene todas las claves en el objeto de los <code>users</code>
|
||||||
testString: 'assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf("Alan") !== -1 && R.indexOf("Jeff") !== -1 && R.indexOf("Sarah") !== -1 && R.indexOf("Ryan") !== -1 && R.indexOf("Sam") !== -1 && R.indexOf("Lewis") !== -1); })() === true, "The <code>getArrayOfUsers</code> function returns an array which contains all the keys in the <code>users</code> object");'
|
testString: 'assert((function() { users.Sam = {}; users.Lewis = {}; let R = getArrayOfUsers(users); return (R.indexOf("Alan") !== -1 && R.indexOf("Jeff") !== -1 && R.indexOf("Sarah") !== -1 && R.indexOf("Ryan") !== -1 && R.indexOf("Sam") !== -1 && R.indexOf("Lewis") !== -1); })() === true, "The <code>getArrayOfUsers</code> function returns an array which contains all the keys in the <code>users</code> object");'
|
||||||
|
@ -23,13 +23,13 @@ Hemos definido una función, <code>filteredArray</code> , que toma <code>arr</co
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> debe devolver <code>[ [10, 8, 3], [14, 6, 23] ]</code> '
|
- text: ' <code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> debe devolver <code>[ [10, 8, 3], [14, 6, 23] ]</code> '
|
||||||
testString: 'assert.deepEqual(filteredArray([ [10, 8, 3], [14, 6, 23], [3, 18, 6] ], 18), [[10, 8, 3], [14, 6, 23]], "<code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> should return <code>[ [10, 8, 3], [14, 6, 23] ]</code>");'
|
testString: 'assert.deepEqual(filteredArray([ [10, 8, 3], [14, 6, 23], [3, 18, 6] ], 18), [[10, 8, 3], [14, 6, 23]], "<code>filteredArray([[10, 8, 3], [14, 6, 23], [3, 18, 6]], 18)</code> should return <code>[ [10, 8, 3], [14, 6, 23] ]</code>");'
|
||||||
- text: ' <code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> debe devolver <code>[ ["flutes", 4] ]</code> '
|
- text: ' <code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> debe devolver <code>[ ["flutes", 4] ]</code> '
|
||||||
testString: 'assert.deepEqual(filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2), [["flutes", 4]], "<code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> should return <code>[ ["flutes", 4] ]</code>");'
|
testString: 'assert.deepEqual(filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2), [["flutes", 4]], "<code>filteredArray([ ["trumpets", 2], ["flutes", 4], ["saxophones", 2] ], 2)</code> should return <code>[ ["flutes", 4] ]</code>");'
|
||||||
- text: ' <code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> debe devolver <code>[ ["amy", "beth", "sam"] ]</code> '
|
- text: ' <code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> debe devolver <code>[ ["amy", "beth", "sam"] ]</code> '
|
||||||
testString: 'assert.deepEqual(filteredArray([["amy", "beth", "sam"], ["dave", "sean", "peter"]], "peter"), [["amy", "beth", "sam"]], "<code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> should return <code>[ ["amy", "beth", "sam"] ]</code>");'
|
testString: 'assert.deepEqual(filteredArray([["amy", "beth", "sam"], ["dave", "sean", "peter"]], "peter"), [["amy", "beth", "sam"]], "<code>filteredArray([ ["amy", "beth", "sam"], ["dave", "sean", "peter"] ], "peter")</code> should return <code>[ ["amy", "beth", "sam"] ]</code>");'
|
||||||
- text: ' <code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> debe devolver <code>[ ]</code> '
|
- text: ' <code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> debe devolver <code>[ ]</code> '
|
||||||
testString: 'assert.deepEqual(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3), [], "<code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> should return <code>[ ]</code>");'
|
testString: 'assert.deepEqual(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3), [], "<code>filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3)</code> should return <code>[ ]</code>");'
|
||||||
- text: El <code>filteredArray</code> función debe utilizar un <code>for</code> bucle
|
- text: El <code>filteredArray</code> función debe utilizar un <code>for</code> bucle
|
||||||
testString: 'assert.notStrictEqual(filteredArray.toString().search(/for/), -1, "The <code>filteredArray</code> function should utilize a <code>for</code> loop");'
|
testString: 'assert.notStrictEqual(filteredArray.toString().search(/for/), -1, "The <code>filteredArray</code> function should utilize a <code>for</code> loop");'
|
||||||
|
@ -20,11 +20,11 @@ Eche un vistazo al objeto que hemos proporcionado en el editor de código. El ob
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El objeto de <code>user</code> tiene <code>name</code> , <code>age</code> y claves de <code>data</code> '
|
- text: 'El objeto de <code>user</code> tiene <code>name</code> , <code>age</code> y claves de <code>data</code> '
|
||||||
testString: 'assert("name" in user && "age" in user && "data" in user, "The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys");'
|
testString: 'assert("name" in user && "age" in user && "data" in user, "The <code>user</code> object has <code>name</code>, <code>age</code>, and <code>data</code> keys");'
|
||||||
- text: La función <code>addFriend</code> acepta un objeto de <code>user</code> y una cadena de <code>friend</code> como argumentos y agrega el amigo a la matriz de <code>friends</code> en el objeto de <code>user</code>
|
- text: La función <code>addFriend</code> acepta un objeto de <code>user</code> y una cadena de <code>friend</code> como argumentos y agrega el amigo a la matriz de <code>friends</code> en el objeto de <code>user</code>
|
||||||
testString: 'assert((function() { let L1 = user.data.friends.length; addFriend(user, "Sean"); let L2 = user.data.friends.length; return (L2 === L1 + 1); })(), "The <code>addFriend</code> function accepts a <code>user</code> object and a <code>friend</code> string as arguments and adds the friend to the array of <code>friends</code> in the <code>user</code> object");'
|
testString: 'assert((function() { let L1 = user.data.friends.length; addFriend(user, "Sean"); let L2 = user.data.friends.length; return (L2 === L1 + 1); })(), "The <code>addFriend</code> function accepts a <code>user</code> object and a <code>friend</code> string as arguments and adds the friend to the array of <code>friends</code> in the <code>user</code> object");'
|
||||||
- text: ' <code>addFriend(user, "Pete")</code> debe devolver <code>["Sam", "Kira", "Tomo", "Pete"]</code> '
|
- text: ' <code>addFriend(user, "Pete")</code> debe devolver <code>["Sam", "Kira", "Tomo", "Pete"]</code> '
|
||||||
testString: 'assert.deepEqual((function() { delete user.data.friends; user.data.friends = ["Sam", "Kira", "Tomo"]; return addFriend(user, "Pete") })(), ["Sam", "Kira", "Tomo", "Pete"], "<code>addFriend(user, "Pete")</code> should return <code>["Sam", "Kira", "Tomo", "Pete"]</code>");'
|
testString: 'assert.deepEqual((function() { delete user.data.friends; user.data.friends = ["Sam", "Kira", "Tomo"]; return addFriend(user, "Pete") })(), ["Sam", "Kira", "Tomo", "Pete"], "<code>addFriend(user, "Pete")</code> should return <code>["Sam", "Kira", "Tomo", "Pete"]</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,7 +22,7 @@ Aquí hemos definido un objeto, <code>userActivity</code> , que incluye otro obj
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>userActivity</code> tiene <code>id</code> , <code>date</code> y propiedades de <code>data</code> '
|
- text: ' <code>userActivity</code> tiene <code>id</code> , <code>date</code> y propiedades de <code>data</code> '
|
||||||
testString: 'assert("id" in userActivity && "date" in userActivity && "data" in userActivity, "<code>userActivity</code> has <code>id</code>, <code>date</code> and <code>data</code> properties");'
|
testString: 'assert("id" in userActivity && "date" in userActivity && "data" in userActivity, "<code>userActivity</code> has <code>id</code>, <code>date</code> and <code>data</code> properties");'
|
||||||
- text: <code>userActivity</code> tiene una clave de <code>data</code> configurada para un objeto con las teclas <code>totalUsers</code> y en <code>online</code>
|
- text: <code>userActivity</code> tiene una clave de <code>data</code> configurada para un objeto con las teclas <code>totalUsers</code> y en <code>online</code>
|
||||||
testString: 'assert("totalUsers" in userActivity.data && "online" in userActivity.data, "<code>userActivity</code> has a <code>data</code> key set to an object with keys <code>totalUsers</code> and <code>online</code>");'
|
testString: 'assert("totalUsers" in userActivity.data && "online" in userActivity.data, "<code>userActivity</code> has a <code>data</code> key set to an object with keys <code>totalUsers</code> and <code>online</code>");'
|
||||||
|
@ -24,7 +24,7 @@ Hemos definido una función, <code>popShift</code> , que toma una matriz como ar
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>popShift(["challenge", "is", "not", "complete"])</code> debe devolver <code>["challenge", "complete"]</code> '
|
- text: ' <code>popShift(["challenge", "is", "not", "complete"])</code> debe devolver <code>["challenge", "complete"]</code> '
|
||||||
testString: 'assert.deepEqual(popShift(["challenge", "is", "not", "complete"]), ["challenge", "complete"], "<code>popShift(["challenge", "is", "not", "complete"])</code> should return <code>["challenge", "complete"]</code>");'
|
testString: 'assert.deepEqual(popShift(["challenge", "is", "not", "complete"]), ["challenge", "complete"], "<code>popShift(["challenge", "is", "not", "complete"])</code> should return <code>["challenge", "complete"]</code>");'
|
||||||
- text: La función <code>popShift</code> debería utilizar el método <code>pop()</code>
|
- text: La función <code>popShift</code> debería utilizar el método <code>pop()</code>
|
||||||
testString: 'assert.notStrictEqual(popShift.toString().search(/\.pop\(/), -1, "The <code>popShift</code> function should utilize the <code>pop()</code> method");'
|
testString: 'assert.notStrictEqual(popShift.toString().search(/\.pop\(/), -1, "The <code>popShift</code> function should utilize the <code>pop()</code> method");'
|
||||||
|
@ -23,9 +23,9 @@ Use la palabra clave delete para eliminar las teclas de <code>oranges</code> , <
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El objeto de <code>foods</code> solo tiene tres claves: <code>apples</code> , <code>grapes</code> y <code>bananas</code> '
|
- text: 'El objeto de <code>foods</code> solo tiene tres claves: <code>apples</code> , <code>grapes</code> y <code>bananas</code> '
|
||||||
testString: 'assert(!foods.hasOwnProperty("oranges") && !foods.hasOwnProperty("plums") && !foods.hasOwnProperty("strawberries") && Object.keys(foods).length === 3, "The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>");'
|
testString: 'assert(!foods.hasOwnProperty("oranges") && !foods.hasOwnProperty("plums") && !foods.hasOwnProperty("strawberries") && Object.keys(foods).length === 3, "The <code>foods</code> object only has three keys: <code>apples</code>, <code>grapes</code>, and <code>bananas</code>");'
|
||||||
- text: 'Las claves de <code>oranges</code> , <code>plums</code> y <code>strawberries</code> se eliminan usando <code>delete</code> '
|
- text: 'Las claves de <code>oranges</code> , <code>plums</code> y <code>strawberries</code> se eliminan usando <code>delete</code> '
|
||||||
testString: 'assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, "The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>");'
|
testString: 'assert(code.search(/oranges:/) !== -1 && code.search(/plums:/) !== -1 && code.search(/strawberries:/) !== -1, "The <code>oranges</code>, <code>plums</code>, and <code>strawberries</code> keys are removed using <code>delete</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -29,7 +29,7 @@ tests:
|
|||||||
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
||||||
- text: Deberías estar usando el método de matriz <code>push</code> .
|
- text: Deberías estar usando el método de matriz <code>push</code> .
|
||||||
testString: 'assert(code.match(/myArray.push/), "You should be using the array method <code>push</code>.");'
|
testString: 'assert(code.match(/myArray.push/), "You should be using the array method <code>push</code>.");'
|
||||||
- text: ' <code>myArray</code> debe ser igual a <code>[9,7,5,3,1]</code> .'
|
- text: ' <code>myArray</code> debe ser igual a <code>[9,7,5,3,1]</code> .'
|
||||||
testString: 'assert.deepEqual(myArray, [9,7,5,3,1], "<code>myArray</code> should equal <code>[9,7,5,3,1]</code>.");'
|
testString: 'assert.deepEqual(myArray, [9,7,5,3,1], "<code>myArray</code> should equal <code>[9,7,5,3,1]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -25,19 +25,19 @@ Escribirás una función de conteo de cartas. Recibirá un parámetro de <code>c
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Las secuencias de cartas 2, 3, 4, 5, 6 deben devolver <code>5 Bet</code> '
|
- text: 'Las secuencias de cartas 2, 3, 4, 5, 6 deben devolver <code>5 Bet</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(2);cc(3);cc(4);cc(5);var out = cc(6); if(out === "5 Bet") {return true;} return false; })(), "Cards Sequence 2, 3, 4, 5, 6 should return <code>5 Bet</code>");'
|
testString: 'assert((function(){ count = 0; cc(2);cc(3);cc(4);cc(5);var out = cc(6); if(out === "5 Bet") {return true;} return false; })(), "Cards Sequence 2, 3, 4, 5, 6 should return <code>5 Bet</code>");'
|
||||||
- text: 'Las secuencias de cartas 7, 8, 9 deben devolver <code>0 Hold</code> '
|
- text: 'Las secuencias de cartas 7, 8, 9 deben devolver <code>0 Hold</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(7);cc(8);var out = cc(9); if(out === "0 Hold") {return true;} return false; })(), "Cards Sequence 7, 8, 9 should return <code>0 Hold</code>");'
|
testString: 'assert((function(){ count = 0; cc(7);cc(8);var out = cc(9); if(out === "0 Hold") {return true;} return false; })(), "Cards Sequence 7, 8, 9 should return <code>0 Hold</code>");'
|
||||||
- text: 'La secuencia de cartas 10, J, Q, K, A debería devolver <code>-5 Hold</code> '
|
- text: 'La secuencia de cartas 10, J, Q, K, A debería devolver <code>-5 Hold</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(10);cc("J");cc("Q");cc("K");var out = cc("A"); if(out === "-5 Hold") {return true;} return false; })(), "Cards Sequence 10, J, Q, K, A should return <code>-5 Hold</code>");'
|
testString: 'assert((function(){ count = 0; cc(10);cc("J");cc("Q");cc("K");var out = cc("A"); if(out === "-5 Hold") {return true;} return false; })(), "Cards Sequence 10, J, Q, K, A should return <code>-5 Hold</code>");'
|
||||||
- text: 'Las secuencias de cartas 3, 7, Q, 8, A deben devolver <code>-1 Hold</code> '
|
- text: 'Las secuencias de cartas 3, 7, Q, 8, A deben devolver <code>-1 Hold</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(3);cc(7);cc("Q");cc(8);var out = cc("A"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 7, Q, 8, A should return <code>-1 Hold</code>");'
|
testString: 'assert((function(){ count = 0; cc(3);cc(7);cc("Q");cc(8);var out = cc("A"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 7, Q, 8, A should return <code>-1 Hold</code>");'
|
||||||
- text: 'Las secuencias de cartas 2, J, 9, 2, 7 deben devolver <code>1 Bet</code> '
|
- text: 'Las secuencias de cartas 2, J, 9, 2, 7 deben devolver <code>1 Bet</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(2);cc("J");cc(9);cc(2);var out = cc(7); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, J, 9, 2, 7 should return <code>1 Bet</code>");'
|
testString: 'assert((function(){ count = 0; cc(2);cc("J");cc(9);cc(2);var out = cc(7); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, J, 9, 2, 7 should return <code>1 Bet</code>");'
|
||||||
- text: 'Las secuencias de cartas 2, 2, 10 deben devolver <code>1 Bet</code> '
|
- text: 'Las secuencias de cartas 2, 2, 10 deben devolver <code>1 Bet</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(2);cc(2);var out = cc(10); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, 2, 10 should return <code>1 Bet</code>");'
|
testString: 'assert((function(){ count = 0; cc(2);cc(2);var out = cc(10); if(out === "1 Bet") {return true;} return false; })(), "Cards Sequence 2, 2, 10 should return <code>1 Bet</code>");'
|
||||||
- text: 'Secuencia de cartas 3, 2, A, 10, K debería devolver <code>-1 Hold</code> '
|
- text: 'Secuencia de cartas 3, 2, A, 10, K debería devolver <code>-1 Hold</code> '
|
||||||
testString: 'assert((function(){ count = 0; cc(3);cc(2);cc("A");cc(10);var out = cc("K"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 2, A, 10, K should return <code>-1 Hold</code>");'
|
testString: 'assert((function(){ count = 0; cc(3);cc(2);cc("A");cc(10);var out = cc("K"); if(out === "-1 Hold") {return true;} return false; })(), "Cards Sequence 3, 2, A, 10, K should return <code>-1 Hold</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ Use la palabra clave <code>var</code> para crear una variable llamada <code>myNa
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Debes declarar <code>myName</code> con la palabra clave <code>var</code> , que termina con un punto y coma'
|
- text: 'Debes declarar <code>myName</code> con la palabra clave <code>var</code> , que termina con un punto y coma'
|
||||||
testString: 'assert(/var\s+myName\s*;/.test(code), "You should declare <code>myName</code> with the <code>var</code> keyword, ending with a semicolon");'
|
testString: 'assert(/var\s+myName\s*;/.test(code), "You should declare <code>myName</code> with the <code>var</code> keyword, ending with a semicolon");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ Aquí está el texto con las secuencias de escape escritas.
|
|||||||
tests:
|
tests:
|
||||||
- text: <code>myStr</code> no debe contener espacios
|
- text: <code>myStr</code> no debe contener espacios
|
||||||
testString: 'assert(!/ /.test(myStr), "<code>myStr</code> should not contain any spaces");'
|
testString: 'assert(!/ /.test(myStr), "<code>myStr</code> should not contain any spaces");'
|
||||||
- text: ' <code>myStr</code> debe contener las cadenas <code>FirstLine</code> , <code>SecondLine</code> y <code>ThirdLine</code> (recuerda la sensibilidad a los casos)'
|
- text: ' <code>myStr</code> debe contener las cadenas <code>FirstLine</code> , <code>SecondLine</code> y <code>ThirdLine</code> (recuerda la sensibilidad a los casos)'
|
||||||
testString: 'assert(/FirstLine/.test(myStr) && /SecondLine/.test(myStr) && /ThirdLine/.test(myStr), "<code>myStr</code> should contain the strings <code>FirstLine</code>, <code>SecondLine</code> and <code>ThirdLine</code> (remember case sensitivity)");'
|
testString: 'assert(/FirstLine/.test(myStr) && /SecondLine/.test(myStr) && /ThirdLine/.test(myStr), "<code>myStr</code> should contain the strings <code>FirstLine</code>, <code>SecondLine</code> and <code>ThirdLine</code> (remember case sensitivity)");'
|
||||||
- text: <code>FirstLine</code> debe ir seguido del carácter de nueva línea <code>\n</code>
|
- text: <code>FirstLine</code> debe ir seguido del carácter de nueva línea <code>\n</code>
|
||||||
testString: 'assert(/FirstLine\n/.test(myStr), "<code>FirstLine</code> should be followed by the newline character <code>\n</code>");'
|
testString: 'assert(/FirstLine\n/.test(myStr), "<code>FirstLine</code> should be followed by the newline character <code>\n</code>");'
|
||||||
|
@ -25,9 +25,9 @@ Use <dfn>barras diagonales inversas</dfn> para asignar una cadena a la variable
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Debería usar dos comillas dobles ( <code>"</code> ) y cuatro comillas dobles escapadas ( <code>\"</code> ).'
|
- text: 'Debería usar dos comillas dobles ( <code>"</code> ) y cuatro comillas dobles escapadas ( <code>\"</code> ).'
|
||||||
testString: 'assert(code.match(/\\"/g).length === 4 && code.match(/[^\\]"/g).length === 2, "You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</code>).");'
|
testString: 'assert(code.match(/\\"/g).length === 4 && code.match(/[^\\]"/g).length === 2, "You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</code>).");'
|
||||||
- text: 'Variable myStr debe contener la cadena: <code>I am a "double quoted" string inside "double quotes".</code> comilla <code>I am a "double quoted" string inside "double quotes".</code> '
|
- text: 'Variable myStr debe contener la cadena: <code>I am a "double quoted" string inside "double quotes".</code> comilla <code>I am a "double quoted" string inside "double quotes".</code> '
|
||||||
testString: 'assert(myStr === "I am a \"double quoted\" string inside \"double quotes\".", "Variable myStr should contain the string: <code>I am a "double quoted" string inside "double quotes".</code>");'
|
testString: 'assert(myStr === "I am a \"double quoted\" string inside \"double quotes\".", "Variable myStr should contain the string: <code>I am a "double quoted" string inside "double quotes".</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ Use la propiedad <code>.length</code> para contar el número de caracteres en la
|
|||||||
tests:
|
tests:
|
||||||
- text: <code>lastNameLength</code> debe ser igual a ocho.
|
- text: <code>lastNameLength</code> debe ser igual a ocho.
|
||||||
testString: 'assert((function(){if(typeof lastNameLength !== "undefined" && typeof lastNameLength === "number" && lastNameLength === 8){return true;}else{return false;}})(), "<code>lastNameLength</code> should be equal to eight.");'
|
testString: 'assert((function(){if(typeof lastNameLength !== "undefined" && typeof lastNameLength === "number" && lastNameLength === 8){return true;}else{return false;}})(), "<code>lastNameLength</code> should be equal to eight.");'
|
||||||
- text: 'Deberías obtener la longitud del <code>lastName</code> al usar <code>.length</code> esta manera: <code>lastName.length</code> '.
|
- text: 'Deberías obtener la longitud del <code>lastName</code> al usar <code>.length</code> esta manera: <code>lastName.length</code> '
|
||||||
testString: 'assert((function(){if(code.match(/\.length/gi) && code.match(/\.length/gi).length >= 2 && code.match(/var lastNameLength \= 0;/gi) && code.match(/var lastNameLength \= 0;/gi).length >= 1){return true;}else{return false;}})(), "You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.");'
|
testString: 'assert((function(){if(code.match(/\.length/gi) && code.match(/\.length/gi).length >= 2 && code.match(/var lastNameLength \= 0;/gi) && code.match(/var lastNameLength \= 0;/gi).length >= 1){return true;}else{return false;}})(), "You should be getting the length of <code>lastName</code> by using <code>.length</code> like this: <code>lastName.length</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,13 +23,13 @@ Cree una función llamada <code>randomRange</code> que tome un rango <code>myMin
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'El número aleatorio más bajo que puede ser generado por <code>randomRange</code> debería ser igual a tu número mínimo, <code>myMin</code> '.
|
- text: 'El número aleatorio más bajo que puede ser generado por <code>randomRange</code> debería ser igual a tu número mínimo, <code>myMin</code> '
|
||||||
testString: 'assert(calcMin === 5, "The lowest random number that can be generated by <code>randomRange</code> should be equal to your minimum number, <code>myMin</code>.");'
|
testString: 'assert(calcMin === 5, "The lowest random number that can be generated by <code>randomRange</code> should be equal to your minimum number, <code>myMin</code>.");'
|
||||||
- text: "El número aleatorio más alto que puede ser generado por <code>randomRange</code> debería ser igual a tu número máximo, <code>myMax</code> ".
|
- text: "El número aleatorio más alto que puede ser generado por <code>randomRange</code> debería ser igual a tu número máximo, <code>myMax</code> ".
|
||||||
testString: 'assert(calcMax === 15, "The highest random number that can be generated by <code>randomRange</code> should be equal to your maximum number, <code>myMax</code>.");'
|
testString: 'assert(calcMax === 15, "The highest random number that can be generated by <code>randomRange</code> should be equal to your maximum number, <code>myMax</code>.");'
|
||||||
- text: 'El número aleatorio generado por <code>randomRange</code> debe ser un número entero, no un decimal'.
|
- text: 'El número aleatorio generado por <code>randomRange</code> debe ser un número entero, no un decimal'
|
||||||
testString: 'assert(randomRange(0,1) % 1 === 0 , "The random number generated by <code>randomRange</code> should be an integer, not a decimal.");'
|
testString: 'assert(randomRange(0,1) % 1 === 0 , "The random number generated by <code>randomRange</code> should be an integer, not a decimal.");'
|
||||||
- text: ' <code>randomRange</code> debe usar <code>myMax</code> y <code>myMin</code> , y devolver un número aleatorio en tu rango'.
|
- text: ' <code>randomRange</code> debe usar <code>myMax</code> y <code>myMin</code> , y devolver un número aleatorio en tu rango'
|
||||||
testString: 'assert((function(){if(code.match(/myMax/g).length > 1 && code.match(/myMin/g).length > 2 && code.match(/Math.floor/g) && code.match(/Math.random/g)){return true;}else{return false;}})(), "<code>randomRange</code> should use both <code>myMax</code> and <code>myMin</code>, and return a random number in your range.");'
|
testString: 'assert((function(){if(code.match(/myMax/g).length > 1 && code.match(/myMin/g).length > 2 && code.match(/Math.floor/g) && code.match(/Math.random/g)){return true;}else{return false;}})(), "<code>randomRange</code> should use both <code>myMax</code> and <code>myMin</code>, and return a random number in your range.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,27 +23,27 @@ Su función se pasará <code>par</code> y <code>strokes</code> argumentos. Devue
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>golfScore(4, 1)</code> debe devolver "Hole-in-one!"'
|
- text: ' <code>golfScore(4, 1)</code> debe devolver "Hole-in-one!"'
|
||||||
testString: 'assert(golfScore(4, 1) === "Hole-in-one!", "<code>golfScore(4, 1)</code> should return "Hole-in-one!"");'
|
testString: 'assert(golfScore(4, 1) === "Hole-in-one!", "<code>golfScore(4, 1)</code> should return "Hole-in-one!"");'
|
||||||
- text: ' <code>golfScore(4, 2)</code> debe devolver "Eagle"'
|
- text: ' <code>golfScore(4, 2)</code> debe devolver "Eagle"'
|
||||||
testString: 'assert(golfScore(4, 2) === "Eagle", "<code>golfScore(4, 2)</code> should return "Eagle"");'
|
testString: 'assert(golfScore(4, 2) === "Eagle", "<code>golfScore(4, 2)</code> should return "Eagle"");'
|
||||||
- text: ' <code>golfScore(5, 2)</code> debe devolver "Eagle"'
|
- text: ' <code>golfScore(5, 2)</code> debe devolver "Eagle"'
|
||||||
testString: 'assert(golfScore(5, 2) === "Eagle", "<code>golfScore(5, 2)</code> should return "Eagle"");'
|
testString: 'assert(golfScore(5, 2) === "Eagle", "<code>golfScore(5, 2)</code> should return "Eagle"");'
|
||||||
- text: ' <code>golfScore(4, 3)</code> debe devolver "Birdie"'
|
- text: ' <code>golfScore(4, 3)</code> debe devolver "Birdie"'
|
||||||
testString: 'assert(golfScore(4, 3) === "Birdie", "<code>golfScore(4, 3)</code> should return "Birdie"");'
|
testString: 'assert(golfScore(4, 3) === "Birdie", "<code>golfScore(4, 3)</code> should return "Birdie"");'
|
||||||
- text: ' <code>golfScore(4, 4)</code> debe devolver "Par"
|
- text: ' <code>golfScore(4, 4)</code> debe devolver "Par"
|
||||||
testString: 'assert(golfScore(4, 4) === "Par", "<code>golfScore(4, 4)</code> should return "Par"");'
|
testString: 'assert(golfScore(4, 4) === "Par", "<code>golfScore(4, 4)</code> should return "Par"");'
|
||||||
- text: ' <code>golfScore(1, 1)</code> debe devolver "Hole-in-one!"'
|
- text: ' <code>golfScore(1, 1)</code> debe devolver "Hole-in-one!"'
|
||||||
testString: 'assert(golfScore(1, 1) === "Hole-in-one!", "<code>golfScore(1, 1)</code> should return "Hole-in-one!"");'
|
testString: 'assert(golfScore(1, 1) === "Hole-in-one!", "<code>golfScore(1, 1)</code> should return "Hole-in-one!"");'
|
||||||
- text: ' <code>golfScore(5, 5)</code> debe devolver "Par"
|
- text: ' <code>golfScore(5, 5)</code> debe devolver "Par"
|
||||||
testString: 'assert(golfScore(5, 5) === "Par", "<code>golfScore(5, 5)</code> should return "Par"");'
|
testString: 'assert(golfScore(5, 5) === "Par", "<code>golfScore(5, 5)</code> should return "Par"");'
|
||||||
- text: ' <code>golfScore(4, 5)</code> debería devolver "Bogey"'
|
- text: ' <code>golfScore(4, 5)</code> debería devolver "Bogey"'
|
||||||
testString: 'assert(golfScore(4, 5) === "Bogey", "<code>golfScore(4, 5)</code> should return "Bogey"");'
|
testString: 'assert(golfScore(4, 5) === "Bogey", "<code>golfScore(4, 5)</code> should return "Bogey"");'
|
||||||
- text: ' <code>golfScore(4, 6)</code> debería devolver "Double Bogey"'
|
- text: ' <code>golfScore(4, 6)</code> debería devolver "Double Bogey"'
|
||||||
testString: 'assert(golfScore(4, 6) === "Double Bogey", "<code>golfScore(4, 6)</code> should return "Double Bogey"");'
|
testString: 'assert(golfScore(4, 6) === "Double Bogey", "<code>golfScore(4, 6)</code> should return "Double Bogey"");'
|
||||||
- text: ' <code>golfScore(4, 7)</code> debe devolver "Go Home!"'
|
- text: ' <code>golfScore(4, 7)</code> debe devolver "Go Home!"'
|
||||||
testString: 'assert(golfScore(4, 7) === "Go Home!", "<code>golfScore(4, 7)</code> should return "Go Home!"");'
|
testString: 'assert(golfScore(4, 7) === "Go Home!", "<code>golfScore(4, 7)</code> should return "Go Home!"");'
|
||||||
- text: ' <code>golfScore(5, 9)</code> debe devolver "Go Home!"'
|
- text: ' <code>golfScore(5, 9)</code> debe devolver "Go Home!"'
|
||||||
testString: 'assert(golfScore(5, 9) === "Go Home!", "<code>golfScore(5, 9)</code> should return "Go Home!"");'
|
testString: 'assert(golfScore(5, 9) === "Go Home!", "<code>golfScore(5, 9)</code> should return "Go Home!"");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -26,7 +26,7 @@ Empuje los números impares del 1 al 9 a <code>myArray</code> usando un bucle <c
|
|||||||
tests:
|
tests:
|
||||||
- text: Usted debe estar usando una <code>for</code> bucle para esto.
|
- text: Usted debe estar usando una <code>for</code> bucle para esto.
|
||||||
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
||||||
- text: ' <code>myArray</code> debería ser igual a <code>[1,3,5,7,9]</code> .'
|
- text: ' <code>myArray</code> debería ser igual a <code>[1,3,5,7,9]</code> .'
|
||||||
testString: 'assert.deepEqual(myArray, [1,3,5,7,9], "<code>myArray</code> should equal <code>[1,3,5,7,9]</code>.");'
|
testString: 'assert.deepEqual(myArray, [1,3,5,7,9], "<code>myArray</code> should equal <code>[1,3,5,7,9]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,7 @@ Cambiar el <code>while</code> de bucle en el código a un <code>do...while</code
|
|||||||
tests:
|
tests:
|
||||||
- text: Deberías usar un bucle <code>do...while</code> while para esto.
|
- text: Deberías usar un bucle <code>do...while</code> while para esto.
|
||||||
testString: 'assert(code.match(/do/g), "You should be using a <code>do...while</code> loop for this.");'
|
testString: 'assert(code.match(/do/g), "You should be using a <code>do...while</code> loop for this.");'
|
||||||
- text: ' <code>myArray</code> debería ser igual a <code>[10]</code> '.
|
- text: ' <code>myArray</code> debería ser igual a <code>[10]</code> '
|
||||||
testString: 'assert.deepEqual(myArray, [10], "<code>myArray</code> should equal <code>[10]</code>.");'
|
testString: 'assert.deepEqual(myArray, [10], "<code>myArray</code> should equal <code>[10]</code>.");'
|
||||||
- text: <code>i</code> debe ser igual a <code>11</code>
|
- text: <code>i</code> debe ser igual a <code>11</code>
|
||||||
testString: 'assert.deepEqual(i, 11, "<code>i</code> should equal <code>11</code>");'
|
testString: 'assert.deepEqual(i, 11, "<code>i</code> should equal <code>11</code>");'
|
||||||
|
@ -31,7 +31,7 @@ Use un bucle <code>for</code> para trabajar y empujar los valores del 1 al 5 en
|
|||||||
tests:
|
tests:
|
||||||
- text: Usted debe estar usando una <code>for</code> bucle para esto.
|
- text: Usted debe estar usando una <code>for</code> bucle para esto.
|
||||||
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
testString: 'assert(code.match(/for\s*\(/g).length > 1, "You should be using a <code>for</code> loop for this.");'
|
||||||
- text: ' <code>myArray</code> debe ser igual a <code>[1,2,3,4,5]</code> .'
|
- text: ' <code>myArray</code> debe ser igual a <code>[1,2,3,4,5]</code> .'
|
||||||
testString: 'assert.deepEqual(myArray, [1,2,3,4,5], "<code>myArray</code> should equal <code>[1,2,3,4,5]</code>.");'
|
testString: 'assert.deepEqual(myArray, [1,2,3,4,5], "<code>myArray</code> should equal <code>[1,2,3,4,5]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -25,7 +25,7 @@ Empuje los números de 0 a 4 para <code>myArray</code> usando un <code>while</co
|
|||||||
tests:
|
tests:
|
||||||
- text: Usted debe utilizar un <code>while</code> de bucle para esto.
|
- text: Usted debe utilizar un <code>while</code> de bucle para esto.
|
||||||
testString: 'assert(code.match(/while/g), "You should be using a <code>while</code> loop for this.");'
|
testString: 'assert(code.match(/while/g), "You should be using a <code>while</code> loop for this.");'
|
||||||
- text: ' <code>myArray</code> debe ser igual a <code>[0,1,2,3,4]</code> .'
|
- text: ' <code>myArray</code> debe ser igual a <code>[0,1,2,3,4]</code> .'
|
||||||
testString: 'assert.deepEqual(myArray, [0,1,2,3,4], "<code>myArray</code> should equal <code>[0,1,2,3,4]</code>.");'
|
testString: 'assert.deepEqual(myArray, [0,1,2,3,4], "<code>myArray</code> should equal <code>[0,1,2,3,4]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,11 +23,11 @@ Use la función <code>.pop()</code> para eliminar el último elemento de <code>m
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray</code> solo debe contener <code>[["John", 23]]</code> .'
|
- text: ' <code>myArray</code> solo debe contener <code>[["John", 23]]</code> .'
|
||||||
testString: 'assert((function(d){if(d[0][0] == "John" && d[0][1] === 23 && d[1] == undefined){return true;}else{return false;}})(myArray), "<code>myArray</code> should only contain <code>[["John", 23]]</code>.");'
|
testString: 'assert((function(d){if(d[0][0] == "John" && d[0][1] === 23 && d[1] == undefined){return true;}else{return false;}})(myArray), "<code>myArray</code> should only contain <code>[["John", 23]]</code>.");'
|
||||||
- text: Usa <code>pop()</code> en <code>myArray</code>
|
- text: Usa <code>pop()</code> en <code>myArray</code>
|
||||||
testString: 'assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(code), "Use <code>pop()</code> on <code>myArray</code>");'
|
testString: 'assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(code), "Use <code>pop()</code> on <code>myArray</code>");'
|
||||||
- text: ' <code>removedFromMyArray</code> solo debe contener <code>["cat", 2]</code> .'
|
- text: ' <code>removedFromMyArray</code> solo debe contener <code>["cat", 2]</code> .'
|
||||||
testString: 'assert((function(d){if(d[0] == "cat" && d[1] === 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray), "<code>removedFromMyArray</code> should only contain <code>["cat", 2]</code>.");'
|
testString: 'assert((function(d){if(d[0] == "cat" && d[1] === 2 && d[2] == undefined){return true;}else{return false;}})(removedFromMyArray), "<code>removedFromMyArray</code> should only contain <code>["cat", 2]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -22,7 +22,7 @@ Presione <code>["dog", 3]</code> en el extremo de la variable <code>my
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray</code> ahora debe ser igual a <code>[["John", 23], ["cat", 2], ["dog", 3]]</code> .'
|
- text: ' <code>myArray</code> ahora debe ser igual a <code>[["John", 23], ["cat", 2], ["dog", 3]]</code> .'
|
||||||
testString: 'assert((function(d){if(d[2] != undefined && d[0][0] == "John" && d[0][1] === 23 && d[2][0] == "dog" && d[2][1] === 3 && d[2].length == 2){return true;}else{return false;}})(myArray), "<code>myArray</code> should now equal <code>[["John", 23], ["cat", 2], ["dog", 3]]</code>.");'
|
testString: 'assert((function(d){if(d[2] != undefined && d[0][0] == "John" && d[0][1] === 23 && d[2][0] == "dog" && d[2][1] === 3 && d[2].length == 2){return true;}else{return false;}})(myArray), "<code>myArray</code> should now equal <code>[["John", 23], ["cat", 2], ["dog", 3]]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -21,9 +21,9 @@ Use la función <code>.shift()</code> para eliminar el primer elemento de <code>
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray</code> ahora debe ser igual a <code>[["dog", 3]]</code> .'
|
- text: ' <code>myArray</code> ahora debe ser igual a <code>[["dog", 3]]</code> .'
|
||||||
testString: 'assert((function(d){if(d[0][0] == "dog" && d[0][1] === 3 && d[1] == undefined){return true;}else{return false;}})(myArray), "<code>myArray</code> should now equal <code>[["dog", 3]]</code>.");'
|
testString: 'assert((function(d){if(d[0][0] == "dog" && d[0][1] === 3 && d[1] == undefined){return true;}else{return false;}})(myArray), "<code>myArray</code> should now equal <code>[["dog", 3]]</code>.");'
|
||||||
- text: ' <code>removedFromMyArray</code> debe contener <code>["John", 23]</code> .'
|
- text: ' <code>removedFromMyArray</code> debe contener <code>["John", 23]</code> .'
|
||||||
testString: 'assert((function(d){if(d[0] == "John" && d[1] === 23 && typeof removedFromMyArray === "object"){return true;}else{return false;}})(removedFromMyArray), "<code>removedFromMyArray</code> should contain <code>["John", 23]</code>.");'
|
testString: 'assert((function(d){if(d[0] == "John" && d[1] === 23 && typeof removedFromMyArray === "object"){return true;}else{return false;}})(removedFromMyArray), "<code>removedFromMyArray</code> should contain <code>["John", 23]</code>.");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -21,7 +21,7 @@ Añadir <code>["Paul",35]</code> para el inicio de la <code>myArray</c
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray</code> debería tener ahora [["Paul", 35], ["dog", 3]].'
|
- text: ' <code>myArray</code> debería tener ahora [["Paul", 35], ["dog", 3]].'
|
||||||
testString: 'assert((function(d){if(typeof d[0] === "object" && d[0][0] == "Paul" && d[0][1] === 35 && d[1][0] != undefined && d[1][0] == "dog" && d[1][1] != undefined && d[1][1] == 3){return true;}else{return false;}})(myArray), "<code>myArray</code> should now have [["Paul", 35], ["dog", 3]].");'
|
testString: 'assert((function(d){if(typeof d[0] === "object" && d[0][0] == "Paul" && d[0][1] === 35 && d[1][0] != undefined && d[1][0] == "dog" && d[1][1] != undefined && d[1][1] == 3){return true;}else{return false;}})(myArray), "<code>myArray</code> should now have [["Paul", 35], ["dog", 3]].");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -31,17 +31,17 @@ tests:
|
|||||||
testString: 'assert(Array.isArray(myMusic), "<code>myMusic</code> should be an array");'
|
testString: 'assert(Array.isArray(myMusic), "<code>myMusic</code> should be an array");'
|
||||||
- text: <code>myMusic</code> debería tener al menos dos elementos
|
- text: <code>myMusic</code> debería tener al menos dos elementos
|
||||||
testString: 'assert(myMusic.length > 1, "<code>myMusic</code> should have at least two elements");'
|
testString: 'assert(myMusic.length > 1, "<code>myMusic</code> should have at least two elements");'
|
||||||
- text: ' <code>myMusic[1]</code> debería ser un objeto'
|
- text: ' <code>myMusic[1]</code> debería ser un objeto'
|
||||||
testString: 'assert(typeof myMusic[1] === "object", "<code>myMusic[1]</code> should be an object");'
|
testString: 'assert(typeof myMusic[1] === "object", "<code>myMusic[1]</code> should be an object");'
|
||||||
- text: ' <code>myMusic[1]</code> debería tener al menos 4 propiedades'
|
- text: ' <code>myMusic[1]</code> debería tener al menos 4 propiedades'
|
||||||
testString: 'assert(Object.keys(myMusic[1]).length > 3, "<code>myMusic[1]</code> should have at least 4 properties");'
|
testString: 'assert(Object.keys(myMusic[1]).length > 3, "<code>myMusic[1]</code> should have at least 4 properties");'
|
||||||
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>artist</code> que es una cadena'
|
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>artist</code> que es una cadena'
|
||||||
testString: 'assert(myMusic[1].hasOwnProperty("artist") && typeof myMusic[1].artist === "string", "<code>myMusic[1]</code> should contain an <code>artist</code> property which is a string");'
|
testString: 'assert(myMusic[1].hasOwnProperty("artist") && typeof myMusic[1].artist === "string", "<code>myMusic[1]</code> should contain an <code>artist</code> property which is a string");'
|
||||||
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>title</code> que es una cadena'
|
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>title</code> que es una cadena'
|
||||||
testString: 'assert(myMusic[1].hasOwnProperty("title") && typeof myMusic[1].title === "string", "<code>myMusic[1]</code> should contain a <code>title</code> property which is a string");'
|
testString: 'assert(myMusic[1].hasOwnProperty("title") && typeof myMusic[1].title === "string", "<code>myMusic[1]</code> should contain a <code>title</code> property which is a string");'
|
||||||
- text: ' <code>myMusic[1]</code> debe contener una propiedad <code>release_year</code> que es un número'
|
- text: ' <code>myMusic[1]</code> debe contener una propiedad <code>release_year</code> que es un número'
|
||||||
testString: 'assert(myMusic[1].hasOwnProperty("release_year") && typeof myMusic[1].release_year === "number", "<code>myMusic[1]</code> should contain a <code>release_year</code> property which is a number");'
|
testString: 'assert(myMusic[1].hasOwnProperty("release_year") && typeof myMusic[1].release_year === "number", "<code>myMusic[1]</code> should contain a <code>release_year</code> property which is a number");'
|
||||||
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>formats</code> que es una matriz'
|
- text: ' <code>myMusic[1]</code> debe contener una propiedad de <code>formats</code> que es una matriz'
|
||||||
testString: 'assert(myMusic[1].hasOwnProperty("formats") && Array.isArray(myMusic[1].formats), "<code>myMusic[1]</code> should contain a <code>formats</code> property which is an array");'
|
testString: 'assert(myMusic[1].hasOwnProperty("formats") && Array.isArray(myMusic[1].formats), "<code>myMusic[1]</code> should contain a <code>formats</code> property which is an array");'
|
||||||
- text: <code>formats</code> deben ser una matriz de cadenas con al menos dos elementos.
|
- text: <code>formats</code> deben ser una matriz de cadenas con al menos dos elementos.
|
||||||
testString: 'assert(myMusic[1].formats.every(function(item) { return (typeof item === "string")}) && myMusic[1].formats.length > 1, "<code>formats</code> should be an array of strings with at least two elements");'
|
testString: 'assert(myMusic[1].formats.every(function(item) { return (typeof item === "string")}) && myMusic[1].formats.length > 1, "<code>formats</code> should be an array of strings with at least two elements");'
|
||||||
|
@ -23,7 +23,7 @@ Modifique los datos almacenados en el índice <code>0</code> de <code>myArray</c
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>myArray</code> ahora debería ser [45,64,99].'
|
- text: ' <code>myArray</code> ahora debería ser [45,64,99].'
|
||||||
testString: 'assert((function(){if(typeof myArray != "undefined" && myArray[0] == 45 && myArray[1] == 64 && myArray[2] == 99){return true;}else{return false;}})(), "<code>myArray</code> should now be [45,64,99].");'
|
testString: 'assert((function(){if(typeof myArray != "undefined" && myArray[0] == 45 && myArray[1] == 64 && myArray[2] == 99){return true;}else{return false;}})(), "<code>myArray</code> should now be [45,64,99].");'
|
||||||
- text: Debe utilizar el índice correcto para modificar el valor en <code>myArray</code> .
|
- text: Debe utilizar el índice correcto para modificar el valor en <code>myArray</code> .
|
||||||
testString: 'assert((function(){if(code.match(/myArray\[0\]\s*=\s*/g)){return true;}else{return false;}})(), "You should be using correct index to modify the value in <code>myArray</code>.");'
|
testString: 'assert((function(){if(code.match(/myArray\[0\]\s*=\s*/g)){return true;}else{return false;}})(), "You should be using correct index to modify the value in <code>myArray</code>.");'
|
||||||
|
@ -22,11 +22,11 @@ Modificar la función <code>multiplyAll</code> para que multiplique la variable
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>multiplyAll([[1],[2],[3]])</code> debe devolver <code>6</code> '
|
- text: ' <code>multiplyAll([[1],[2],[3]])</code> debe devolver <code>6</code> '
|
||||||
testString: 'assert(multiplyAll([[1],[2],[3]]) === 6, "<code>multiplyAll([[1],[2],[3]])</code> should return <code>6</code>");'
|
testString: 'assert(multiplyAll([[1],[2],[3]]) === 6, "<code>multiplyAll([[1],[2],[3]])</code> should return <code>6</code>");'
|
||||||
- text: ' <code>multiplyAll([[1,2],[3,4],[5,6,7]])</code> debe devolver <code>5040</code> '
|
- text: ' <code>multiplyAll([[1,2],[3,4],[5,6,7]])</code> debe devolver <code>5040</code> '
|
||||||
testString: 'assert(multiplyAll([[1,2],[3,4],[5,6,7]]) === 5040, "<code>multiplyAll([[1,2],[3,4],[5,6,7]])</code> should return <code>5040</code>");'
|
testString: 'assert(multiplyAll([[1,2],[3,4],[5,6,7]]) === 5040, "<code>multiplyAll([[1,2],[3,4],[5,6,7]])</code> should return <code>5040</code>");'
|
||||||
- text: ' <code>multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]])</code> debe devolver <code>54</code> '
|
- text: ' <code>multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]])</code> debe devolver <code>54</code> '
|
||||||
testString: 'assert(multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) === 54, "<code>multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]])</code> should return <code>54</code>");'
|
testString: 'assert(multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) === 54, "<code>multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]])</code> should return <code>54</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -27,9 +27,9 @@ Hemos pasado dos argumentos, <code>"Hello"</code> y <code>"World&
|
|||||||
tests:
|
tests:
|
||||||
- text: <code>functionWithArgs</code> debería ser una función
|
- text: <code>functionWithArgs</code> debería ser una función
|
||||||
testString: 'assert(typeof functionWithArgs === "function", "<code>functionWithArgs</code> should be a function");'
|
testString: 'assert(typeof functionWithArgs === "function", "<code>functionWithArgs</code> should be a function");'
|
||||||
- text: ' <code>functionWithArgs(1,2)</code> debe generar <code>3</code> '
|
- text: ' <code>functionWithArgs(1,2)</code> debe generar <code>3</code> '
|
||||||
testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(1,2); uncapture(); } assert(logOutput == 3, "<code>functionWithArgs(1,2)</code> should output <code>3</code>");'
|
testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(1,2); uncapture(); } assert(logOutput == 3, "<code>functionWithArgs(1,2)</code> should output <code>3</code>");'
|
||||||
- text: ' <code>functionWithArgs(7,9)</code> debe generar <code>16</code> '
|
- text: ' <code>functionWithArgs(7,9)</code> debe generar <code>16</code> '
|
||||||
testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16, "<code>functionWithArgs(7,9)</code> should output <code>16</code>");'
|
testString: 'if(typeof functionWithArgs === "function") { capture(); functionWithArgs(7,9); uncapture(); } assert(logOutput == 16, "<code>functionWithArgs(7,9)</code> should output <code>16</code>");'
|
||||||
- text: Llame a <code>functionWithArgs</code> con dos números después de definirlo.
|
- text: Llame a <code>functionWithArgs</code> con dos números después de definirlo.
|
||||||
testString: 'assert(/^\s*functionWithArgs\s*\(\s*\d+\s*,\s*\d+\s*\)\s*;/m.test(code), "Call <code>functionWithArgs</code> with two numbers after you define it.");'
|
testString: 'assert(/^\s*functionWithArgs\s*\(\s*\d+\s*,\s*\d+\s*\)\s*;/m.test(code), "Call <code>functionWithArgs</code> with two numbers after you define it.");'
|
||||||
|
@ -25,9 +25,9 @@ La función <code>compareEquality</code> en el editor compara dos valores utiliz
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>compareEquality(10, "10")</code> debe devolver "Not Equal"'
|
- text: ' <code>compareEquality(10, "10")</code> debe devolver "Not Equal"'
|
||||||
testString: 'assert(compareEquality(10, "10") === "Not Equal", "<code>compareEquality(10, "10")</code> should return "Not Equal"");'
|
testString: 'assert(compareEquality(10, "10") === "Not Equal", "<code>compareEquality(10, "10")</code> should return "Not Equal"");'
|
||||||
- text: ' <code>compareEquality("20", 20)</code> debe devolver "Not Equal"'
|
- text: ' <code>compareEquality("20", 20)</code> debe devolver "Not Equal"'
|
||||||
testString: 'assert(compareEquality("20", 20) === "Not Equal", "<code>compareEquality("20", 20)</code> should return "Not Equal"");'
|
testString: 'assert(compareEquality("20", 20) === "Not Equal", "<code>compareEquality("20", 20)</code> should return "Not Equal"");'
|
||||||
- text: Debes usar el operador <code>===</code>
|
- text: Debes usar el operador <code>===</code>
|
||||||
testString: 'assert(code.match(/===/g), "You should use the <code>===</code> operator");'
|
testString: 'assert(code.match(/===/g), "You should use the <code>===</code> operator");'
|
||||||
|
@ -25,17 +25,17 @@ Si la <code>prop</code> no corresponde a ninguna propiedad válida de un contact
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>"Kristian", "lastName"</code> debería devolver <code>"Vos"</code> '
|
- text: ' <code>"Kristian", "lastName"</code> debería devolver <code>"Vos"</code> '
|
||||||
testString: 'assert(lookUpProfile("Kristian","lastName") === "Vos", "<code>"Kristian", "lastName"</code> should return <code>"Vos"</code>");'
|
testString: 'assert(lookUpProfile("Kristian","lastName") === "Vos", "<code>"Kristian", "lastName"</code> should return <code>"Vos"</code>");'
|
||||||
- text: ' <code>"Sherlock", "likes"</code> debería devolver <code>["Intriguing Cases", "Violin"]</code> '
|
- text: ' <code>"Sherlock", "likes"</code> debería devolver <code>["Intriguing Cases", "Violin"]</code> '
|
||||||
testString: 'assert.deepEqual(lookUpProfile("Sherlock", "likes"), ["Intriguing Cases", "Violin"], "<code>"Sherlock", "likes"</code> should return <code>["Intriguing Cases", "Violin"]</code>");'
|
testString: 'assert.deepEqual(lookUpProfile("Sherlock", "likes"), ["Intriguing Cases", "Violin"], "<code>"Sherlock", "likes"</code> should return <code>["Intriguing Cases", "Violin"]</code>");'
|
||||||
- text: ' <code>"Harry","likes"</code> debería devolver una matriz'
|
- text: ' <code>"Harry","likes"</code> debería devolver una matriz'
|
||||||
testString: 'assert(typeof lookUpProfile("Harry", "likes") === "object", "<code>"Harry","likes"</code> should return an array");'
|
testString: 'assert(typeof lookUpProfile("Harry", "likes") === "object", "<code>"Harry","likes"</code> should return an array");'
|
||||||
- text: ' <code>"Bob", "number"</code> debe devolver "No existe tal contacto"'
|
- text: ' <code>"Bob", "number"</code> debe devolver "No existe tal contacto"'
|
||||||
testString: 'assert(lookUpProfile("Bob", "number") === "No such contact", "<code>"Bob", "number"</code> should return "No such contact"");'
|
testString: 'assert(lookUpProfile("Bob", "number") === "No such contact", "<code>"Bob", "number"</code> should return "No such contact"");'
|
||||||
- text: ' <code>"Bob", "potato"</code> debe devolver "No hay tal contacto"'
|
- text: ' <code>"Bob", "potato"</code> debe devolver "No hay tal contacto"'
|
||||||
testString: 'assert(lookUpProfile("Bob", "potato") === "No such contact", "<code>"Bob", "potato"</code> should return "No such contact"");'
|
testString: 'assert(lookUpProfile("Bob", "potato") === "No such contact", "<code>"Bob", "potato"</code> should return "No such contact"");'
|
||||||
- text: ' <code>"Akira", "address"</code> debe devolver "No existe tal propiedad"
|
- text: ' <code>"Akira", "address"</code> debe devolver "No existe tal propiedad"
|
||||||
testString: 'assert(lookUpProfile("Akira", "address") === "No such property", "<code>"Akira", "address"</code> should return "No such property"");'
|
testString: 'assert(lookUpProfile("Akira", "address") === "No such property", "<code>"Akira", "address"</code> should return "No such property"");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -30,7 +30,7 @@ En este momento, la etiqueta <code><a></code> en la cadena usa comillas do
|
|||||||
tests:
|
tests:
|
||||||
- text: Eliminar todas las <code>backslashes</code> ( <code>\</code> )
|
- text: Eliminar todas las <code>backslashes</code> ( <code>\</code> )
|
||||||
testString: 'assert(!/\\/g.test(code) && myStr.match("\\s*<a href\\s*=\\s*"http://www.example.com"\\s*target\\s*=\\s*"_blank">\\s*Link\\s*</a>\\s*"), "Remove all the <code>backslashes</code> (<code>\</code>)");'
|
testString: 'assert(!/\\/g.test(code) && myStr.match("\\s*<a href\\s*=\\s*"http://www.example.com"\\s*target\\s*=\\s*"_blank">\\s*Link\\s*</a>\\s*"), "Remove all the <code>backslashes</code> (<code>\</code>)");'
|
||||||
- text: 'Debería tener dos comillas simples <code>'</code> y cuatro comillas dobles <code>"</code> '
|
- text: 'Debería tener dos comillas simples <code>'</code> y cuatro comillas dobles <code>"</code> '
|
||||||
testString: 'assert(code.match(/"/g).length === 4 && code.match(/"/g).length === 2, "You should have two single quotes <code>'</code> and four double quotes <code>"</code>");'
|
testString: 'assert(code.match(/"/g).length === 4 && code.match(/"/g).length === 2, "You should have two single quotes <code>'</code> and four double quotes <code>"</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -30,19 +30,19 @@ Puede volver a consultar <a href="javascript-algorithms-and-data-structures/basi
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: 'Después de <code>updateRecords(5439, "artist", "ABBA")</code> , el <code>artist</code> debe ser <code>"ABBA"</code> '
|
- text: 'Después de <code>updateRecords(5439, "artist", "ABBA")</code> , el <code>artist</code> debe ser <code>"ABBA"</code> '
|
||||||
testString: 'collection = collectionCopy; assert(updateRecords(5439, "artist", "ABBA")[5439]["artist"] === "ABBA", "After <code>updateRecords(5439, "artist", "ABBA")</code>, <code>artist</code> should be <code>"ABBA"</code>");'
|
testString: 'collection = collectionCopy; assert(updateRecords(5439, "artist", "ABBA")[5439]["artist"] === "ABBA", "After <code>updateRecords(5439, "artist", "ABBA")</code>, <code>artist</code> should be <code>"ABBA"</code>");'
|
||||||
- text: 'Después de <code>updateRecords(5439, "tracks", "Take a Chance on Me")</code> , los <code>tracks</code> deberían tener <code>"Take a Chance on Me"</code> como el último elemento.'
|
- text: 'Después de <code>updateRecords(5439, "tracks", "Take a Chance on Me")</code> , los <code>tracks</code> deberían tener <code>"Take a Chance on Me"</code> como el último elemento.'
|
||||||
testString: 'assert(updateRecords(5439, "tracks", "Take a Chance on Me")[5439]["tracks"].pop() === "Take a Chance on Me", "After <code>updateRecords(5439, "tracks", "Take a Chance on Me")</code>, <code>tracks</code> should have <code>"Take a Chance on Me"</code> as the last element.");'
|
testString: 'assert(updateRecords(5439, "tracks", "Take a Chance on Me")[5439]["tracks"].pop() === "Take a Chance on Me", "After <code>updateRecords(5439, "tracks", "Take a Chance on Me")</code>, <code>tracks</code> should have <code>"Take a Chance on Me"</code> as the last element.");'
|
||||||
- text: 'Después de <code>updateRecords(2548, "artist", "")</code> , el <code>artist</code> no debe configurarse'
|
- text: 'Después de <code>updateRecords(2548, "artist", "")</code> , el <code>artist</code> no debe configurarse'
|
||||||
testString: 'updateRecords(2548, "artist", ""); assert(!collection[2548].hasOwnProperty("artist"), "After <code>updateRecords(2548, "artist", "")</code>, <code>artist</code> should not be set");'
|
testString: 'updateRecords(2548, "artist", ""); assert(!collection[2548].hasOwnProperty("artist"), "After <code>updateRecords(2548, "artist", "")</code>, <code>artist</code> should not be set");'
|
||||||
- text: 'Después de <code>updateRecords(1245, "tracks", "Addicted to Love")</code> , las <code>tracks</code> deberían tener <code>"Addicted to Love"</code> como último elemento.'
|
- text: 'Después de <code>updateRecords(1245, "tracks", "Addicted to Love")</code> , las <code>tracks</code> deberían tener <code>"Addicted to Love"</code> como último elemento.'
|
||||||
testString: 'assert(updateRecords(1245, "tracks", "Addicted to Love")[1245]["tracks"].pop() === "Addicted to Love", "After <code>updateRecords(1245, "tracks", "Addicted to Love")</code>, <code>tracks</code> should have <code>"Addicted to Love"</code> as the last element.");'
|
testString: 'assert(updateRecords(1245, "tracks", "Addicted to Love")[1245]["tracks"].pop() === "Addicted to Love", "After <code>updateRecords(1245, "tracks", "Addicted to Love")</code>, <code>tracks</code> should have <code>"Addicted to Love"</code> as the last element.");'
|
||||||
- text: 'Después de <code>updateRecords(2468, "tracks", "Free")</code> , los <code>tracks</code> deberían tener <code>"1999"</code> como primer elemento.'
|
- text: 'Después de <code>updateRecords(2468, "tracks", "Free")</code> , los <code>tracks</code> deberían tener <code>"1999"</code> como primer elemento.'
|
||||||
testString: 'assert(updateRecords(2468, "tracks", "Free")[2468]["tracks"][0] === "1999", "After <code>updateRecords(2468, "tracks", "Free")</code>, <code>tracks</code> should have <code>"1999"</code> as the first element.");'
|
testString: 'assert(updateRecords(2468, "tracks", "Free")[2468]["tracks"][0] === "1999", "After <code>updateRecords(2468, "tracks", "Free")</code>, <code>tracks</code> should have <code>"1999"</code> as the first element.");'
|
||||||
- text: 'Después de <code>updateRecords(2548, "tracks", "")</code> , no se deben establecer <code>tracks</code> '
|
- text: 'Después de <code>updateRecords(2548, "tracks", "")</code> , no se deben establecer <code>tracks</code> '
|
||||||
testString: 'updateRecords(2548, "tracks", ""); assert(!collection[2548].hasOwnProperty("tracks"), "After <code>updateRecords(2548, "tracks", "")</code>, <code>tracks</code> should not be set");'
|
testString: 'updateRecords(2548, "tracks", ""); assert(!collection[2548].hasOwnProperty("tracks"), "After <code>updateRecords(2548, "tracks", "")</code>, <code>tracks</code> should not be set");'
|
||||||
- text: 'Después de <code>updateRecords(1245, "album", "Riptide")</code> , el <code>album</code> debería ser <code>"Riptide"</code> '
|
- text: 'Después de <code>updateRecords(1245, "album", "Riptide")</code> , el <code>album</code> debería ser <code>"Riptide"</code> '
|
||||||
testString: 'assert(updateRecords(1245, "album", "Riptide")[1245]["album"] === "Riptide", "After <code>updateRecords(1245, "album", "Riptide")</code>, <code>album</code> should be <code>"Riptide"</code>");'
|
testString: 'assert(updateRecords(1245, "album", "Riptide")[1245]["album"] === "Riptide", "After <code>updateRecords(1245, "album", "Riptide")</code>, <code>album</code> should be <code>"Riptide"</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,7 @@ tests:
|
|||||||
testString: 'assert(chainToSwitch("bob") === "Marley", "<code>chainToSwitch("bob")</code> should be "Marley"");'
|
testString: 'assert(chainToSwitch("bob") === "Marley", "<code>chainToSwitch("bob")</code> should be "Marley"");'
|
||||||
- text: <code>chainToSwitch(42)</code> debe ser "La Respuesta"
|
- text: <code>chainToSwitch(42)</code> debe ser "La Respuesta"
|
||||||
testString: 'assert(chainToSwitch(42) === "The Answer", "<code>chainToSwitch(42)</code> should be "The Answer"");'
|
testString: 'assert(chainToSwitch(42) === "The Answer", "<code>chainToSwitch(42)</code> should be "The Answer"");'
|
||||||
- text: ' <code>chainToSwitch(1)</code> debe ser "No hay # 1"'
|
- text: ' <code>chainToSwitch(1)</code> debe ser "No hay # 1"'
|
||||||
testString: 'assert(chainToSwitch(1) === "There is no #1", "<code>chainToSwitch(1)</code> should be "There is no #1"");'
|
testString: 'assert(chainToSwitch(1) === "There is no #1", "<code>chainToSwitch(1)</code> should be "There is no #1"");'
|
||||||
- text: <code>chainToSwitch(99)</code> debería ser "¡Me <code>chainToSwitch(99)</code> por esto!"
|
- text: <code>chainToSwitch(99)</code> debería ser "¡Me <code>chainToSwitch(99)</code> por esto!"
|
||||||
testString: 'assert(chainToSwitch(99) === "Missed me by this much!", "<code>chainToSwitch(99)</code> should be "Missed me by this much!"");'
|
testString: 'assert(chainToSwitch(99) === "Missed me by this much!", "<code>chainToSwitch(99)</code> should be "Missed me by this much!"");'
|
||||||
|
@ -24,17 +24,17 @@ Modifique la función <code>abTest</code> para que si <code>a</code> o <code>b</
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
tests:
|
tests:
|
||||||
- text: ' <code>abTest(2,2)</code> debe devolver un número'
|
- text: ' <code>abTest(2,2)</code> debe devolver un número'
|
||||||
testString: 'assert(typeof abTest(2,2) === "number" , "<code>abTest(2,2)</code> should return a number");'
|
testString: 'assert(typeof abTest(2,2) === "number" , "<code>abTest(2,2)</code> should return a number");'
|
||||||
- text: ' <code>abTest(2,2)</code> debe devolver <code>8</code> '
|
- text: ' <code>abTest(2,2)</code> debe devolver <code>8</code> '
|
||||||
testString: 'assert(abTest(2,2) === 8 , "<code>abTest(2,2)</code> should return <code>8</code>");'
|
testString: 'assert(abTest(2,2) === 8 , "<code>abTest(2,2)</code> should return <code>8</code>");'
|
||||||
- text: ' <code>abTest(-2,2)</code> debe devolver <code>undefined</code> '
|
- text: ' <code>abTest(-2,2)</code> debe devolver <code>undefined</code> '
|
||||||
testString: 'assert(abTest(-2,2) === undefined , "<code>abTest(-2,2)</code> should return <code>undefined</code>");'
|
testString: 'assert(abTest(-2,2) === undefined , "<code>abTest(-2,2)</code> should return <code>undefined</code>");'
|
||||||
- text: ' <code>abTest(2,-2)</code> debe devolver <code>undefined</code> '
|
- text: ' <code>abTest(2,-2)</code> debe devolver <code>undefined</code> '
|
||||||
testString: 'assert(abTest(2,-2) === undefined , "<code>abTest(2,-2)</code> should return <code>undefined</code>");'
|
testString: 'assert(abTest(2,-2) === undefined , "<code>abTest(2,-2)</code> should return <code>undefined</code>");'
|
||||||
- text: ' <code>abTest(2,8)</code> debe devolver <code>18</code> '
|
- text: ' <code>abTest(2,8)</code> debe devolver <code>18</code> '
|
||||||
testString: 'assert(abTest(2,8) === 18 , "<code>abTest(2,8)</code> should return <code>18</code>");'
|
testString: 'assert(abTest(2,8) === 18 , "<code>abTest(2,8)</code> should return <code>18</code>");'
|
||||||
- text: ' <code>abTest(3,3)</code> debe devolver <code>12</code> '
|
- text: ' <code>abTest(3,3)</code> debe devolver <code>12</code> '
|
||||||
testString: 'assert(abTest(3,3) === 12 , "<code>abTest(3,3)</code> should return <code>12</code>");'
|
testString: 'assert(abTest(3,3) === 12 , "<code>abTest(3,3)</code> should return <code>12</code>");'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user