-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.js
36 lines (33 loc) · 967 Bytes
/
index.test.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
const createFrame = require('./index');
describe('02 => Enmarcando-nombres', () => {
const TEST_CASES = [
{
input: ['midu'],
output: '********\n* midu *\n********',
},
{
input: ['midu', 'madeval', 'educalvolpz'],
output:
'***************\n* midu *\n* madeval *\n* educalvolpz *\n***************',
},
{
input: ['a', 'bb', 'ccc'],
output: '*******\n* a *\n* bb *\n* ccc *\n*******',
},
{
input: ['midu', 'madeval', 'educalvolpz', 'midu'],
output:
'***************\n* midu *\n* madeval *\n* educalvolpz *\n* midu *\n***************',
},
];
it('should return an array type', () => {
const { input } = TEST_CASES[0];
expect(typeof createFrame(input)).toBe('string');
});
it.each(TEST_CASES)(
'should return the correct frame',
({ input, output }) => {
expect(createFrame(input)).toBe(output);
},
);
});