-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.spec.js
37 lines (28 loc) · 1.09 KB
/
index.spec.js
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
const { parser, printer } = require('.');
describe('# Works with the message if man was meant to stay on the ground god would have given us roots', () => {
const matrix = parser('if man was meant to stay on the ground god would have given us roots');
it('Should have length of 7x8', () => {
expect(matrix).toHaveLength(7);
});
it('Should print correctly', () => {
expect(printer(matrix)).toEqual('imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau');
});
});
describe('# Works with the message have a nice day', () => {
const matrix = parser('have a nice day');
it('Should have length of 3x4', () => {
expect(matrix).toHaveLength(3);
});
it('Should print correctly', () => {
expect(printer(matrix)).toEqual('hae and via ecy');
});
});
describe('# Works with the message chill out', () => {
const matrix = parser('chill out');
it('Should have length of 3x3', () => {
expect(matrix).toHaveLength(3);
});
it('Should print correctly', () => {
expect(printer(matrix)).toEqual('clu hlt io');
});
});