From 006ca7fb06c5b6304804371e794105336225fae7 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Sat, 15 Jan 2022 17:14:13 +0100 Subject: [PATCH] test: Failing test case for missing exports when using ImportNamespaceSpecifier --- .../configCases/compiletime/error-maybe-found/index.js | 10 ++++++++++ test/configCases/compiletime/error-maybe-found/stub.js | 1 + .../compiletime/error-maybe-found/webpack.config.js | 6 ++++++ test/configCases/compiletime/warn-maybe-found/index.js | 10 ++++++++++ test/configCases/compiletime/warn-maybe-found/stub.js | 1 + .../compiletime/warn-maybe-found/webpack.config.js | 0 6 files changed, 28 insertions(+) create mode 100644 test/configCases/compiletime/error-maybe-found/index.js create mode 100644 test/configCases/compiletime/error-maybe-found/stub.js create mode 100644 test/configCases/compiletime/error-maybe-found/webpack.config.js create mode 100644 test/configCases/compiletime/warn-maybe-found/index.js create mode 100644 test/configCases/compiletime/warn-maybe-found/stub.js create mode 100644 test/configCases/compiletime/warn-maybe-found/webpack.config.js 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