|
1 | 1 | /* É importada nesse arquivo tanto as funções do gabarito quanto dos desafios */ |
2 | 2 |
|
3 | | -/* Gabarito */ |
4 | | -/* const { |
| 3 | +/* Gabaritos */ |
| 4 | +const { |
5 | 5 | getMaxNumber, |
6 | 6 | getMinNumber, |
7 | 7 | findQuest, |
8 | 8 | dataType, |
9 | 9 | findOldestSon, |
10 | | -} = require("../Desafios/Arrays/Gabaritos/1-5"); */ |
| 10 | +} = require("../Desafios/Arrays/Gabaritos/1-5"); |
11 | 11 |
|
12 | 12 | /* Exercícios */ |
13 | | -const { |
| 13 | +/* const { |
14 | 14 | getMaxNumber, |
15 | 15 | getMinNumber, |
16 | 16 | findQuest, |
17 | 17 | dataType, |
18 | 18 | findOldestSon, |
19 | | -} = require("../Desafios/Arrays/") |
| 19 | +} = require("../Desafios/Arrays/") */ |
20 | 20 |
|
21 | 21 | describe("Desafios de Arrays.", () => { |
22 | 22 | describe("01 - Testando a Função getMaxNumber.", () => { |
23 | | - it("Ao passar o argumento [3, 1, 8, 34, 13, 2, 5], deve retornar 34.", () => { |
| 23 | + it("Ao passar o argumento [3, 1, 8, 34, 13, 2, 5], deve retornar: 34", () => { |
24 | 24 | expect(getMaxNumber([3, 1, 8, 34, 13, 2, 5])).toBe(34); |
25 | 25 | }); |
26 | | - it("Ao passar o argumento [-8, 12, 13, 84, -100, 45, 38], deve retornar 84.", () => { |
| 26 | + it("Ao passar o argumento [-8, 12, 13, 84, -100, 45, 38], deve retornar: 84", () => { |
27 | 27 | expect(getMaxNumber([-8, 12, 13, 84, -100, 45, 38])).toBe(84); |
28 | 28 | }); |
29 | 29 | }); |
30 | 30 |
|
31 | 31 | describe("02 - Testando a Função getMinNumber.", () => { |
32 | | - it("Ao passar o argumento [3, 1, 8, 34, 13, 2, 5], deve retornar 1.", () => { |
| 32 | + it("Ao passar o argumento [3, 1, 8, 34, 13, 2, 5], deve retornar: 1", () => { |
33 | 33 | expect(getMinNumber([3, 1, 8, 34, 13, 2, 5])).toBe(1); |
34 | 34 | }); |
35 | | - it("Ao passar o argumento [-8, 12, 13, 84, -100, 45, 38], deve retornar -100.", () => { |
| 35 | + it("Ao passar o argumento [-8, 12, 13, 84, -100, 45, 38], deve retornar: -100", () => { |
36 | 36 | expect(getMinNumber([-8, 12, 13, 84, -100, 45, 38])).toBe(-100); |
37 | 37 | }); |
38 | 38 | }); |
39 | 39 |
|
40 | 40 | describe("03 - Testando a Função findQuest.", () => { |
41 | | - it("Ao passar os argumentos ['Silvia', 'Isa', 'Mica', 'Amanda'] e 'Mica', deve retornar 'O nome está na lista'.", () => { |
| 41 | + it("Ao passar os argumentos ['Silvia', 'Isa', 'Mica', 'Amanda'] e 'Mica', deve retornar: 'O nome está na lista.'", () => { |
42 | 42 | expect(findQuest(['Silvia', 'Isa', 'Mica', 'Amanda'], 'Mica')).toBe( |
43 | 43 | "O nome está na lista." |
44 | 44 | ); |
45 | 45 | }); |
46 | | - it("Ao passar os argumentos ['Silvia', 'Isa', 'Mica', 'Amanda']' e 'Daniel', deve retornar 'O nome não está na lista'.", () => { |
| 46 | + it("Ao passar os argumentos ['Silvia', 'Isa', 'Mica', 'Amanda']' e 'Daniel', deve retornar: 'O nome não está na lista.'", () => { |
47 | 47 | expect(findQuest(['Silvia', 'Isa', 'Mica', 'Amanda'], 'Daniel')).toBe( |
48 | 48 | 'O nome não está na lista.' |
49 | 49 | ); |
50 | 50 | }); |
51 | 51 | }); |
52 | 52 |
|
53 | 53 | describe("04 - Testando a Função dataType.", () => { |
54 | | - it("Ao passar o argumento ['Daniel', 'John', 'Marcos'], deve retornar true.", () => { |
| 54 | + it("Ao passar o argumento ['Daniel', 'John', 'Marcos'], deve retornar: true", () => { |
55 | 55 | expect(dataType(['Daniel', 'John', 'Marcos'])).toBe(true); |
56 | 56 | }); |
57 | | - it("Ao passar o argumento ['Daniel', 'John', 1], deve retornar false.", () => { |
| 57 | + it("Ao passar o argumento ['Daniel', 'John', 1], deve retornar: false", () => { |
58 | 58 | expect(dataType(["Daniel", "John", 1])).toBe(false); |
59 | 59 | }); |
60 | | - it("Ao passar o argumento [ 40, 121, -14], deve retornar true.", () => { |
| 60 | + it("Ao passar o argumento [ 40, 121, -14], deve retornar: true", () => { |
61 | 61 | expect(dataType([40, 121, -14])).toBe(true); |
62 | 62 | }); |
63 | | - it("Ao passar o argumento [true, false, true], deve retornar true.", () => { |
| 63 | + it("Ao passar o argumento [true, false, true], deve retornar: true", () => { |
64 | 64 | expect(dataType([true, false, true])).toBe(true); |
65 | 65 | }); |
66 | | - it("Ao passar o argumento [true, false, 0], deve retornar false.", () => { |
| 66 | + it("Ao passar o argumento [true, false, 0], deve retornar: false", () => { |
67 | 67 | expect(dataType([true, false, 0])).toBe(false); |
68 | 68 | }); |
69 | 69 | }); |
70 | 70 |
|
71 | 71 | describe("05 - Testando a Função findOldestSon.", () => { |
72 | | - it("Ao passar os argumentos 40, e [10, 10, 10], deve retornar 'O filho mais velho tem 10 anos.'.", () => { |
| 72 | + it("Ao passar os argumentos 40 e [10, 10, 10], deve retornar: 'O filho mais velho tem 10 anos.'", () => { |
73 | 73 | expect(findOldestSon(40, [10, 10, 10])).toBe( |
74 | 74 | "O filho mais velho tem 10 anos." |
75 | 75 | ); |
76 | 76 | }); |
77 | | - it("Ao passar os argumentos 60 e [12, 16, 20], deve retornar 'O filho mais velho tem 21 anos.'.", () => { |
| 77 | + it("Ao passar os argumentos 60 e [12, 16, 20], deve retornar: 'O filho mais velho tem 21 anos.'", () => { |
78 | 78 | expect(findOldestSon(60, [11, 16, 12])).toBe( |
79 | 79 | "O filho mais velho tem 21 anos." |
80 | 80 | ); |
81 | 81 | }); |
82 | | - it("Ao passar os argumentos 40 e [10, 7, 14], deve retornar 'O filho mais velho tem 14 anos'", () => { |
| 82 | + it("Ao passar os argumentos 40 e [10, 7, 14], deve retornar: 'O filho mais velho tem 14 anos.'", () => { |
83 | 83 | expect(findOldestSon(40, [10, 7, 14])).toEqual( |
84 | 84 | "O filho mais velho tem 14 anos." |
85 | 85 | ); |
|
0 commit comments