-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.spec.ts
29 lines (25 loc) · 927 Bytes
/
test.spec.ts
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
import { MODULE_DEFINITIONS, alias, entries } from '..'
describe('es modules', () => {
it('entries should contain all definition keys', () => {
expect(entries.map(({ find }) => find)).toEqual(
expect.arrayContaining(Object.keys(MODULE_DEFINITIONS)),
)
})
it('should contain extra keys from definitions', () => {
const extraKeys = entries
.map(({ find }) => find)
.filter(_ => !Object.keys(MODULE_DEFINITIONS).includes(_ as string))
expect(extraKeys).toBeTruthy()
expect(extraKeys.every(key => key instanceof RegExp)).toBe(true)
})
it('alias should contain all definition keys', () => {
expect(Object.keys(alias)).toEqual(
expect.arrayContaining(Object.keys(MODULE_DEFINITIONS)),
)
})
it('alias should contain same number of definition keys', () => {
expect(Object.keys(alias).length).toEqual(
Object.keys(MODULE_DEFINITIONS).length,
)
})
})