Skip to content

Commit

Permalink
improve test cases for more edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 1, 2019
1 parent 49dc747 commit 61d508e
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/configCases/loaders/issue-9053/a.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/configCases/loaders/issue-9053/b.js
@@ -1 +1 @@
module.exports = "b";
module.exports = ["b"];
1 change: 1 addition & 0 deletions test/configCases/loaders/issue-9053/c.js
@@ -0,0 +1 @@
module.exports = ["c"];
16 changes: 14 additions & 2 deletions test/configCases/loaders/issue-9053/index.js
@@ -1,5 +1,17 @@
it("should apply inline loaders before matchResource", function() {
var foo = require("./a");
var foo = require("c.js!=!loader1!./b.js");

expect(foo).toBe("d");
expect(foo).toEqual(["b", "1", "2"]);
});

it("should apply config loaders before inline loaders", function() {
var foo = require("loader1!./c.js");

expect(foo).toEqual(["c", "2", "1"]);
});

it("should not apply config loaders when matchResource is used", function() {
var foo = require("d.js!=!loader1!./c.js");

expect(foo).toEqual(["c", "1", "3"]);
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/configCases/loaders/issue-9053/node_modules/loader3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/configCases/loaders/issue-9053/webpack.config.js
Expand Up @@ -4,6 +4,10 @@ module.exports = {
{
test: /c\.js$/,
use: ["loader2"]
},
{
test: /d\.js$/,
use: ["loader3"]
}
]
}
Expand Down

0 comments on commit 61d508e

Please sign in to comment.