diff --git a/test/configCases/compiletime/error-maybe-found/index.js b/test/configCases/compiletime/error-maybe-found/index.js new file mode 100644 index 000000000..07b714e3f --- /dev/null +++ b/test/configCases/compiletime/error-maybe-found/index.js @@ -0,0 +1,10 @@ +import * as Stub from "./stub"; + +it("should compile", function () { + if (typeof Stub.NotHere !== "undefined") { + throw new Error("This shouldn't be here!"); + } + if (typeof Stub.Here === "undefined") { + throw new Error("This should be here!"); + } +}); diff --git a/test/configCases/compiletime/error-maybe-found/stub.js b/test/configCases/compiletime/error-maybe-found/stub.js new file mode 100644 index 000000000..4643b6be1 --- /dev/null +++ b/test/configCases/compiletime/error-maybe-found/stub.js @@ -0,0 +1 @@ +export const Here = "exists"; diff --git a/test/configCases/compiletime/error-maybe-found/webpack.config.js b/test/configCases/compiletime/error-maybe-found/webpack.config.js new file mode 100644 index 000000000..e3128523e --- /dev/null +++ b/test/configCases/compiletime/error-maybe-found/webpack.config.js @@ -0,0 +1,6 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + module: { + strictExportPresence: true + } +}; diff --git a/test/configCases/compiletime/warn-maybe-found/index.js b/test/configCases/compiletime/warn-maybe-found/index.js new file mode 100644 index 000000000..07b714e3f --- /dev/null +++ b/test/configCases/compiletime/warn-maybe-found/index.js @@ -0,0 +1,10 @@ +import * as Stub from "./stub"; + +it("should compile", function () { + if (typeof Stub.NotHere !== "undefined") { + throw new Error("This shouldn't be here!"); + } + if (typeof Stub.Here === "undefined") { + throw new Error("This should be here!"); + } +}); diff --git a/test/configCases/compiletime/warn-maybe-found/stub.js b/test/configCases/compiletime/warn-maybe-found/stub.js new file mode 100644 index 000000000..4643b6be1 --- /dev/null +++ b/test/configCases/compiletime/warn-maybe-found/stub.js @@ -0,0 +1 @@ +export const Here = "exists"; diff --git a/test/configCases/compiletime/warn-maybe-found/webpack.config.js b/test/configCases/compiletime/warn-maybe-found/webpack.config.js new file mode 100644 index 000000000..e69de29bb