-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenge15.test.js
More file actions
55 lines (50 loc) · 888 Bytes
/
challenge15.test.js
File metadata and controls
55 lines (50 loc) · 888 Bytes
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
const decorateTree = require('./index.js')
test('Test #1 - Retorna un array', () => {
expect(
Array.isArray(
decorateTree('B P R P')
)
).toStrictEqual(true)
})
test("Test #2 - decorateTree('B P R P')", () => {
expect(
decorateTree('B P R P')
).toStrictEqual([
"R",
"P B",
"R B B",
"B P R P"
])
})
test("Test #3 - decorateTree('B B')", () => {
expect(
decorateTree('B B')
).toStrictEqual([
"B",
"B B"
])
})
test("Test #4 - decorateTree('B B P R P R R')", () => {
expect(
decorateTree('B B P R P R R')
).toStrictEqual([
"B",
"R P",
"B P P",
"P R B R",
"P P B B P",
"B R B B B R",
"B B P R P R R"
])
})
test("Test #5 - decorateTree('R R P R R')", () => {
expect(
decorateTree('R R P R R')
).toStrictEqual([
"R",
"R R",
"P B P",
"R B B R",
"R R P R R"
])
})