forked from jsmapr1/simplifying-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.spec.js
More file actions
45 lines (38 loc) · 1.11 KB
/
filter.spec.js
File metadata and controls
45 lines (38 loc) · 1.11 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
import expect from 'expect';
import {
getDaveVariants,
findMemorialInstructor,
findAnyInstructor,
getNumberOfPassingScores,
getPerfectScores,
instructors,
scores,
team,
} from './filter';
import {
getDaveVariants as getDaveVariantsFull,
findMemorialInstructor as findMemorialInstructorFull,
} from './full';
describe('filters', () => {
it('should get the daves', () => {
expect(getDaveVariants(team).length).toEqual(3);
});
it('should find a single instructor', () => {
expect(findMemorialInstructor(instructors).name).toEqual('Sarah');
});
it('should get the daves', () => {
expect(getDaveVariantsFull(team).length).toEqual(3);
});
it('should find a single instructor', () => {
expect(findMemorialInstructorFull(instructors).name).toEqual('Sarah');
});
it('should get passing scores', () => {
expect(getNumberOfPassingScores(scores)).toEqual(2);
});
it('should get perfect scores', () => {
expect(getPerfectScores(scores)).toEqual(0);
});
it('should use a curry functions', () => {
expect(findAnyInstructor(instructors).name).toEqual('Jim');
});
});