Skip to content

Commit

Permalink
Creacion test funcion aniadirProducto para añadir un producto a una d…
Browse files Browse the repository at this point in the history
…ieta #55 [skip ci]
  • Loading branch information
josemip98 committed Dec 11, 2020
1 parent ca6c900 commit b993bde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/dieta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ describe("Testeando el método aniadirProducto()", () => {
proteinas = "6,5g";
hidratos = "79g";
producto = new Producto(nombre,calorias,grasa,proteinas,hidratos);
thrown_error = () => dieta.aniadirProducto(producto);
var tam_vector_esperado = dieta.listaProductos.length+1;
dieta.aniadirProducto(producto);
var tam_productos = dieta.listaProductos.length;
expect(tam_vector_esperado).toEqual(tam_productos);
});
});

Expand Down

0 comments on commit b993bde

Please sign in to comment.