-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
38 lines (36 loc) · 1.05 KB
/
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
37
38
const chai = require('chai')
const chaiImmutable = require('chai-immutable')
const { matchSnapshot } = require('chai-karma-snapshot')
const enzyme = require('enzyme')
const Adapter = require('enzyme-adapter-react-16')
const { Map } = require('immutable')
const getParentChildrenMap = require('./getParentChildrenMap')
const testsContext = require.context('.', false, /\.spec\.js$/)
testsContext.keys().forEach(testsContext)
enzyme.configure({ adapter: new Adapter() })
chai.use(chaiImmutable)
chai.use(matchSnapshot)
chai.config.truncateThreshold = 0
beforeEach(function() {
// a0
// ├── a1
// │ ├── a2
// │ └── b2
// │ ├── a3
// │ └── b3
// └── b1
// ├── c2
// └── d2
this.childParentMap = new Map({
a0: undefined,
a1: 'a0',
b1: 'a0',
a2: 'a1',
b2: 'a1',
c2: 'b1',
d2: 'b1',
a3: 'b2',
b3: 'b2',
})
this.parentChildrenMap = getParentChildrenMap(this.childParentMap)
})