-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenge19.test.js
More file actions
62 lines (57 loc) · 1.39 KB
/
challenge19.test.js
File metadata and controls
62 lines (57 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const sortToys = require('./index.js')
test('Test #1 - Retorna un Array', () => {
expect(
Array.isArray(
sortToys(['ball', 'doll', 'car', 'puzzle'], [2, 3, 1, 0])
)
).toStrictEqual(true)
})
test("Test #2 - sortToys(['ball', 'doll', 'car', 'puzzle'], [2, 3, 1, 0])", () => {
expect(
sortToys(['ball', 'doll', 'car', 'puzzle'], [2, 3, 1, 0])
).toStrictEqual([
"puzzle",
"car",
"ball",
"doll"
])
})
test("Test #3 - sortToys(['pc', 'xbox', 'ps4', 'switch', 'nintendo'], [3, 1, 0, 2, 4])", () => {
expect(
sortToys(['pc', 'xbox', 'ps4', 'switch', 'nintendo'], [3, 1, 0, 2, 4])
).toStrictEqual([
"ps4",
"xbox",
"switch",
"pc",
"nintendo"
])
})
test("Test #4 - sortToys(['pc', 'xbox', 'ps4', 'switch', 'nintendo'], [8, 6, 5, 7, 9])", () => {
expect(
sortToys(['pc', 'xbox', 'ps4', 'switch', 'nintendo'], [8, 6, 5, 7, 9])
).toStrictEqual([
"ps4",
"xbox",
"switch",
"pc",
"nintendo"
])
})
test("Test #5 - sortToys(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l'], [1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1111])", () => {
expect(
sortToys(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l'], [1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1111])
).toStrictEqual([
"l",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"j",
"k"
])
})