add test case

This commit is contained in:
Ivan Kopeykin 2022-02-25 10:28:34 +03:00
parent 8d1e46e523
commit 0a7446b187
6 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1 @@
export default "a";

View File

@ -0,0 +1,5 @@
{
"name": "foo",
"version": "1.0.0",
"module": "./a.js"
}

View File

@ -0,0 +1 @@
export default "b";

View File

@ -0,0 +1,5 @@
{
"name": "foo",
"version": "1.0.0",
"module": "./b.js"
}

View File

@ -0,0 +1,7 @@
const a = String.fromCharCode("a".charCodeAt(0));
const b = String.fromCharCode("b".charCodeAt(0));
it("should compile correctly", async () => {
expect((await /* webpackMode: "lazy" */ import(`foo/${a}`)).default).toEqual({});
expect((await /* webpackMode: "lazy" */ import(`foo/${b}`)).default).toBe("b");
});

View File

@ -0,0 +1,11 @@
const path = require("path");
/** @type {import("../../../../").Configuration} */
module.exports = {
resolve: {
modules: [path.resolve(__dirname, "a"), path.resolve(__dirname, "b")],
alias: {
[path.resolve(__dirname, "a/foo")]: false
}
}
};