Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add cjs test cases - add esm test cases, filter them for now
- Loading branch information
Showing
16 changed files
with
23 additions
and
10 deletions.
There are no files selected for viewing
11 changes: 2 additions & 9 deletions
11
test/cases/loaders/package-type/index.js → test/cases/loaders/cjs-loader-type/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
it("should pass package.json type to loader", function (done) { | ||
it("should pass package.json type to loader", function () { | ||
expect(require("cjs/loader.js!")).toBe("commonjs"); | ||
expect(require("esm/loader.js!")).toBe("module"); | ||
expect(require("./loader.js!")).toBe("undefined"); | ||
}); | ||
|
||
it("should pass 'commonjs' type to loader for .cjs", function () { | ||
expect(require("cjs/loader.cjs!")).toBe("commonjs"); | ||
expect(require("esm/loader.cjs!")).toBe("commonjs"); | ||
expect(require("./loader.cjs!")).toBe("commonjs"); | ||
}); | ||
|
||
it("should pass 'module' type to loader for .mjs", function () { | ||
expect(require("cjs/loader.mjs!")).toBe("module"); | ||
expect(require("esm/loader.mjs!")).toBe("module"); | ||
expect(require("./loader.mjs!")).toBe("module"); | ||
expect(require("esm/loader.cjs!")).toBe("commonjs"); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
it("should pass package.json type to loader", function () { | ||
expect(require("esm/loader.js!")).toBe("module"); | ||
}); | ||
|
||
it("should pass 'module' type to loader for .mjs", function () { | ||
expect(require("cjs/loader.mjs!")).toBe("module"); | ||
expect(require("esm/loader.mjs!")).toBe("module"); | ||
expect(require("./loader.mjs!")).toBe("module"); | ||
}); |
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
test/cases/loaders/esm-loader-type/node_modules/cjs/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...s/package-type/node_modules/esm/loader.js → ...sm-loader-type/node_modules/esm/loader.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
test/cases/loaders/esm-loader-type/node_modules/esm/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function(config) { | ||
return false; | ||
}; |