-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenge01.test.js
More file actions
40 lines (35 loc) · 876 Bytes
/
challenge01.test.js
File metadata and controls
40 lines (35 loc) · 876 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
const wrapping = require('./index.js')
test('Test #01 - Returns an Array', () => {
expect(
Array.isArray(
wrapping([ "cat", "game", "socks" ])
)
).toBe(true)
})
test('Test #02 - wrapping([ "cat", "game", "socks" ])', () => {
expect(wrapping([ "cat", "game", "socks" ])).toStrictEqual(
[
"*****\n*cat*\n*****",
"******\n*game*\n******",
"*******\n*socks*\n*******"
]
)
})
test('Test #03 - wrapping([ "midu", "achalogy" ])', () => {
expect(wrapping([ "midu", "achalogy" ])).toStrictEqual(
[
"******\n*midu*\n******",
"**********\n*achalogy*\n**********"
]
)
})
test('Test #04 - wrapping([ "a" ])', () => {
expect(wrapping([ "a" ])).toStrictEqual(
[
"***\n*a*\n***"
]
)
})
test('Test #05 - Empty Array Should return an Empty Array', () => {
expect(wrapping([])).toStrictEqual([])
})