-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
36 lines (30 loc) · 996 Bytes
/
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 { getInspirationCard } = require('./index.js');
const edition1 = require('./data/edition1.json');
const edition2 = require('./data/edition2.json');
const edition3 = require('./data/edition3.json');
const edition4 = require('./data/edition4.json');
global.Math.random = () => 0.5;
describe('Get Inspirational Card (edition 1)', () => {
it('returns a card', () => {
const card = getInspirationCard(1);
expect(edition1).toContain(card);
});
});
describe('Get Inspirational Card (edition 2)', () => {
it('returns a card', () => {
const card = getInspirationCard(2);
expect(edition2).toContain(card);
});
});
describe('Get Inspirational Card (edition 3, default)', () => {
it('returns a card', () => {
const card = getInspirationCard();
expect(edition3).toContain(card);
});
});
describe('Get Inspirational Card (edition 4)', () => {
it('returns a card', () => {
const card = getInspirationCard(4);
expect(edition4).toContain(card);
});
});