/
steal_clone_test.js
56 lines (41 loc) · 2 KB
/
steal_clone_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var QUnit = require("steal-qunit");
var helpers = require("./helpers");
var makeIframe = helpers.makeIframe;
var supportsES = helpers.supportsProto();
QUnit.module("steal-clone extension tests");
QUnit.test("basics work", function(assert) {
makeIframe("ext-steal-clone/basics/index.html", assert);
});
QUnit.test("does not share the module registry and extensions with cloned loader", function(assert) {
makeIframe("ext-steal-clone/config-separation/index.html", assert);
});
QUnit.test("allows you to override a module with a default export", function(assert) {
makeIframe("ext-steal-clone/default-export-usedefault/index.html", assert);
});
QUnit.test("allows you to override a module with a default export without setting __useDefault", function(assert) {
makeIframe("ext-steal-clone/default-export/index.html", assert);
});
QUnit.test("caches source of parent modules to avoid duplicate downloads", function(assert) {
makeIframe("ext-steal-clone/fetch-cache/index.html", assert);
});
QUnit.test("works when overriding multiple modules", function(assert) {
makeIframe("ext-steal-clone/multiple-overrides/index.html", assert);
});
(supportsES ? QUnit.test : QUnit.skip)("works when using the npm extensions", function(assert) {
makeIframe("ext-steal-clone/npm-extension/index.html", assert);
});
QUnit.test("works when a parent of injected dependency has been imported", function(assert) {
makeIframe("ext-steal-clone/prior-import/index.html", assert);
});
QUnit.test("works when using relative imports", function(assert) {
makeIframe("ext-steal-clone/relative-import/index.html", assert);
});
QUnit.test("works when using relative overrides", function(assert) {
makeIframe("ext-steal-clone/relative-override/index.html", assert);
});
QUnit.test("what happens within a cloned loader should not leak", function(assert) {
makeIframe("ext-steal-clone/leak/index.html", assert);
});
QUnit.test("multiple clones can work at different paths", function(assert) {
makeIframe("ext-steal-clone/multiple/index.html", assert);
});