-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
/
index.js
61 lines (60 loc) · 1.13 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
it("should be possible to import json data async", function() {
return Promise.all([
import("../data/a.json"),
import("../data/b.json"),
import("../data/c.json"),
import("../data/d.json"),
import("../data/e.json"),
import("../data/f.json"),
import("../data/g.json")
]).then(([a, b, c, d, e, f, g]) => {
expect(a).toEqual({
default: null,
[Symbol.toStringTag]: "Module"
});
expect(b).toEqual({
default: 123,
[Symbol.toStringTag]: "Module"
});
expect(c).toEqual({
0: 1,
1: 2,
2: 3,
3: 4,
default: [1, 2, 3, 4],
[Symbol.toStringTag]: "Module"
});
expect(d).toEqual({
default: {},
[Symbol.toStringTag]: "Module"
});
expect(e).toEqual({
aa: 1,
bb: 2,
1: "x",
default: {
aa: 1,
bb: 2,
"1": "x"
},
[Symbol.toStringTag]: "Module"
});
expect(f).toEqual({
named: "named",
default: {
named: "named",
"default": "default",
__esModule: true
},
[Symbol.toStringTag]: "Module"
});
expect(g).toEqual({
named: {},
default: {
named: {}
},
[Symbol.toStringTag]: "Module"
});
expect(g.named).toBe(g.default.named);
});
});