forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (37 loc) · 1.55 KB
/
index.js
File metadata and controls
41 lines (37 loc) · 1.55 KB
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
it("should replace a module with a module", function() {
expect(require("replacing-module1")).toBe("new-module");
});
it("should replace a module with a file in a module", function() {
expect(require("replacing-module2")).toBe("new-module/inner");
});
it("should replace a module with file in the same module", function() {
expect(require("replacing-module3")).toBe("new-module/inner");
});
it("should replace a module with a file in the current module", function() {
expect(require("replacing-module4")).toBe("replacing-module4/module");
});
it("should replace a file with another file", function() {
expect(require("replacing-file1")).toBe("new-file");
});
it("should replace a file with a module", function() {
expect(require("replacing-file2")).toBe("new-module");
});
it("should replace a file with a file in a module", function() {
expect(require("replacing-file3")).toBe("new-module/inner");
});
it("should replace a file in a directory with another file", function() {
expect(require("replacing-file4")).toBe("new-file");
});
it("should ignore recursive module mappings", function() {
expect(require("recursive-module")).toBe("new-module");
});
it("should use empty modules for ignored modules", function() {
expect(require("ignoring-module").module).toEqual({});
expect(require("ignoring-module").file).toEqual({});
expect(require("ignoring-module").module).not.toBe(require("ignoring-module").file);
});
// Errors
require.include("recursive-file/a");
require.include("recursive-file/b");
require.include("recursive-file/c");
require.include("recursive-file/d");