forked from jsmapr1/simplifying-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpartial.spec.js
More file actions
59 lines (53 loc) · 1.57 KB
/
Copy pathpartial.spec.js
File metadata and controls
59 lines (53 loc) · 1.57 KB
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
56
57
58
59
import expect from 'expect';
import {
mergeProgramInformation as mergeProblem,
} from './problem';
import {
setStrongHallProgram,
} from './program';
import {
building,
exhibit,
manager,
mergeProgramInformation,
program,
zip,
} from './partial';
describe('partially applied functions', () => {
const programInfo = {
name: 'Presenting Research',
room: '415',
hours: '3 - 6',
address: 'Jayhawk Blvd',
contact: 'Augusto',
phone: '555-555-5555',
};
const exhibitInfo = {
name: 'Emerging Scholarship',
contact: 'Dyan',
hours: '8 a.m. - 8 p.m.',
address: 'Jayhawk Blvd',
phone: '555-555-5555',
};
it('should merge program information', () => {
expect(mergeProblem(building, manager, program)).toEqual(programInfo);
expect(mergeProblem(building, manager, exhibit)).toEqual(exhibitInfo);
});
it('should merge program information', () => {
expect(mergeProgramInformation(building, manager)(program)).toEqual(programInfo);
expect(mergeProgramInformation(building, manager)(exhibit)).toEqual(exhibitInfo);
});
it('should encapsulate some information', () => {
expect(setStrongHallProgram(program)).toEqual(programInfo);
expect(setStrongHallProgram(exhibit)).toEqual(exhibitInfo);
});
it('should zip together information', () => {
const states = ['kansas', 'wisconsin', 'new mexico'];
const birds = ['meadowlark', 'robin', 'roadrunner'];
expect(zip(...states)(...birds)).toEqual([
['kansas', 'meadowlark'],
['wisconsin', 'robin'],
['new mexico', 'roadrunner'],
]);
});
});