fix test
This commit is contained in:
parent
d6af29698e
commit
df80f5ae95
|
@ -1,2 +0,0 @@
|
|||
import "./empty";
|
||||
exports.type = "ambiguous";
|
|
@ -1,2 +0,0 @@
|
|||
require("./empty");
|
||||
export default "ambiguous";
|
|
@ -1,2 +0,0 @@
|
|||
require.resolve("./empty");
|
||||
export default "ambiguous";
|
|
@ -1,2 +0,0 @@
|
|||
import "./empty";
|
||||
require("./empty");
|
|
@ -1,5 +0,0 @@
|
|||
import "./empty";
|
||||
|
||||
Object.assign({}, module.exports, {
|
||||
type: "ambiguous"
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
import "./empty";
|
||||
|
||||
Object.assign({}, exports, {
|
||||
type: "ambiguous"
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
require("./empty");
|
||||
require.resolve("./empty");
|
||||
|
||||
module.exports = {};
|
||||
exports.x = true;
|
|
@ -1,7 +0,0 @@
|
|||
import "./empty";
|
||||
|
||||
let define = () => {};
|
||||
let require = () => {};
|
||||
|
||||
define();
|
||||
require();
|
|
@ -1,10 +0,0 @@
|
|||
it("should compile and run the test", () => {
|
||||
require("./cases/amb1");
|
||||
require("./cases/amb2");
|
||||
require("./cases/amb3");
|
||||
require("./cases/amb4");
|
||||
require("./cases/amb5");
|
||||
require("./cases/amb6");
|
||||
require("./cases/dyn");
|
||||
require("./cases/esm");
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
module.exports = [];
|
||||
|
||||
for (let i = 1; i <= 6; ++i) {
|
||||
module.exports.push([new RegExp(`amb${i}`), /ambiguous/]);
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
const webpack = require("../../../../");
|
||||
|
||||
module.exports = {
|
||||
plugins: [new webpack.WarnAmbiguousSourceTypePlugin()]
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
module.exports = 1;
|
|
@ -0,0 +1 @@
|
|||
module.exports = 2;
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "cjs",
|
||||
"type": "commonjs",
|
||||
"main": "./index.js"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export const a = 1;
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "esm",
|
||||
"type": "module",
|
||||
"exports": "./auto.js"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
module.exports.b = 1;
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "track",
|
||||
"type": "commonjs"
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import "./cases/cjs"
|
||||
import "./cases/esm/auto"
|
||||
import {b} from "./cases/track/a"
|
||||
import "./cases/auto/auto"
|
||||
|
||||
it("should compile and run the test", () => {
|
||||
expect(b).toBe(1);
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
module.exports = [
|
||||
/javascript\/auto/,
|
||||
/javascript\/dynamic/
|
||||
];
|
|
@ -0,0 +1,13 @@
|
|||
const path = require("path");
|
||||
const webpack = require("../../../../");
|
||||
|
||||
/** @type {import("../../../../").Configuration} */
|
||||
module.exports = {
|
||||
optimization: false,
|
||||
plugins: [
|
||||
new webpack.WarnNonEsmSourceTypePlugin(
|
||||
path.resolve(__dirname, "cases/track")
|
||||
),
|
||||
new webpack.WarnNonEsmSourceTypePlugin(/auto/)
|
||||
]
|
||||
};
|
Loading…
Reference in New Issue