File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Desafío
2
2
3
- Tienen que importar e instanciar las clases User y Producto y probar todos sus métodos
3
+ El objetivo de este desafío es hacer TDD (Test Driven Development) y guiarse con los tests
4
+ para que funcione el resto del código. Para esto tienen que leet los test y
5
+ procurar que las clases 'User' y 'Producto' funcionen junto con todos sus métodos
4
6
5
7
# Código
6
8
7
9
Los archivos están en la carpeta ./src
8
10
9
11
# Para inicializar este proyecto
10
12
11
- Correr: ` npm install ` o ` yarn install ` en el caso de que utilices yarn.
13
+ ``` sh
14
+ pnpm install
15
+ ```
16
+
17
+ o
18
+
19
+ ``` sh
20
+ yarn install
21
+ ```
12
22
13
23
# Para correr los tests ejecutar
14
24
15
- ` npm run test `
25
+ ``` sh
26
+ npm run test
27
+ ```
28
+
29
+ En principio van a fallar. El objetivo es entender que te piden los test y
30
+ modificar el resto del código para que los tests pasen.
16
31
17
32
# Para correr los tests en modo watch (reinicia automáticamente)
18
33
19
- ` npm run test:watch `
34
+ ``` sh
35
+ npm run test:watch
36
+ ```
Original file line number Diff line number Diff line change @@ -7,12 +7,17 @@ test("Testeo la clase User", (t) => {
7
7
t . is ( user . name , "marce" ) ;
8
8
} ) ;
9
9
10
- // descomentar el siguiente test para trabajarlo
10
+ // El siguiente text va a fallar inicialmente, el objetivo es
11
+ // entender que te pide el test y hacer los cambios necesarios
12
+ // no modifiques el test. El test es una guía para entender
13
+ // que debería pasar.
11
14
12
15
test ( "Testeo la clase Product y sus métodos" , ( t ) => {
13
16
const user = new User ( "marce" ) ;
14
17
const producto = new Product ( "termo" , 500 ) ;
15
- // este test va a fallar porque el método estatico findProductsBelow no existe
18
+
19
+ // El método estatico findProductsBelow no existe
20
+ // tenés que hacer que funcione
16
21
const productosNoTanCaros = Product . findProductsBelow ( 250 ) ;
17
22
18
23
user . addProduct ( producto ) ;
You can’t perform that action at this time.
0 commit comments