Skip to content

Commit

Permalink
Add ext priority test for options.cjs.paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Sep 17, 2018
1 parent 85cd3c1 commit 9339890
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/cjs/ext/priority.js
@@ -0,0 +1,6 @@
import assert from "assert"
import ext from "../../fixture/cjs/ext/priority"

export default () => {
assert.strictEqual(ext, ".js")
}
5 changes: 5 additions & 0 deletions test/misc-tests.js
Expand Up @@ -677,6 +677,11 @@ describe("miscellaneous tests", () => {
))
)

it("should find `.js` before `.mjs` with `options.cjs.paths`", () =>
import("./cjs/ext/priority.js")
.then((ns) => ns.default())
)

it("should support modified `require.extensions` in CJS", () => {
require.extensions[".mjs"] = () => ({})

Expand Down

0 comments on commit 9339890

Please sign in to comment.