forked from jsmapr1/simplifying-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.spec.js
More file actions
42 lines (37 loc) · 1012 Bytes
/
map.spec.js
File metadata and controls
42 lines (37 loc) · 1012 Bytes
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
import expect from 'expect';
import { getInstruments, getInstruments2 } from './map';
import { getInstruments as g1, getInstruments2 as g2 } from './full';
describe('full loops', () => {
const band = [
{
name: 'corbett',
instrument: 'guitar',
},
{
name: 'evan',
instrument: 'guitar',
},
{
name: 'sean',
instrument: 'bass',
},
{
name: 'brett',
instrument: 'drums',
},
];
it('should get instruments', () => {
expect(g1(band)).toEqual(['guitar', 'guitar', 'bass', 'drums']);
});
it('should get instruments with anonymous function', () => {
expect(g2(band)).toEqual(['guitar', 'guitar', 'bass', 'drums']);
});
});
describe('map', () => {
it('should get instruments', () => {
expect(getInstruments()).toEqual(['guitar', 'guitar', 'bass', 'drums']);
});
it('should get instruments with anonymous function', () => {
expect(getInstruments2()).toEqual(['guitar', 'guitar', 'bass', 'drums']);
});
});