From a0ab325dc55dd3179cb6f0524ae63c50c368f8e3 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 16 Jul 2020 08:05:37 +0200 Subject: [PATCH] add test case for watching in production --- test/watchCases/simple/production/0/changing-file.js | 1 + test/watchCases/simple/production/0/changing-module.js | 1 + test/watchCases/simple/production/0/index.js | 6 ++++++ test/watchCases/simple/production/1/changing-file.js | 1 + test/watchCases/simple/production/1/changing-module.js | 1 + test/watchCases/simple/production/2/changing-file.js | 1 + test/watchCases/simple/production/2/changing-module.js | 1 + test/watchCases/simple/production/webpack.config.js | 4 ++++ 8 files changed, 16 insertions(+) create mode 100644 test/watchCases/simple/production/0/changing-file.js create mode 100644 test/watchCases/simple/production/0/changing-module.js create mode 100644 test/watchCases/simple/production/0/index.js create mode 100644 test/watchCases/simple/production/1/changing-file.js create mode 100644 test/watchCases/simple/production/1/changing-module.js create mode 100644 test/watchCases/simple/production/2/changing-file.js create mode 100644 test/watchCases/simple/production/2/changing-module.js create mode 100644 test/watchCases/simple/production/webpack.config.js diff --git a/test/watchCases/simple/production/0/changing-file.js b/test/watchCases/simple/production/0/changing-file.js new file mode 100644 index 000000000..335d3d1ad --- /dev/null +++ b/test/watchCases/simple/production/0/changing-file.js @@ -0,0 +1 @@ +module.exports = "0"; diff --git a/test/watchCases/simple/production/0/changing-module.js b/test/watchCases/simple/production/0/changing-module.js new file mode 100644 index 000000000..b428ff41a --- /dev/null +++ b/test/watchCases/simple/production/0/changing-module.js @@ -0,0 +1 @@ +export default "0"; diff --git a/test/watchCases/simple/production/0/index.js b/test/watchCases/simple/production/0/index.js new file mode 100644 index 000000000..b335a3e45 --- /dev/null +++ b/test/watchCases/simple/production/0/index.js @@ -0,0 +1,6 @@ +import module from "./changing-module"; + +it("should watch for changes", function () { + expect(require("./changing-file")).toBe(WATCH_STEP); + expect(module).toBe(WATCH_STEP); +}); diff --git a/test/watchCases/simple/production/1/changing-file.js b/test/watchCases/simple/production/1/changing-file.js new file mode 100644 index 000000000..ba0e0f3e1 --- /dev/null +++ b/test/watchCases/simple/production/1/changing-file.js @@ -0,0 +1 @@ +module.exports = "1"; diff --git a/test/watchCases/simple/production/1/changing-module.js b/test/watchCases/simple/production/1/changing-module.js new file mode 100644 index 000000000..508074e2a --- /dev/null +++ b/test/watchCases/simple/production/1/changing-module.js @@ -0,0 +1 @@ +export default "1"; diff --git a/test/watchCases/simple/production/2/changing-file.js b/test/watchCases/simple/production/2/changing-file.js new file mode 100644 index 000000000..c202b8513 --- /dev/null +++ b/test/watchCases/simple/production/2/changing-file.js @@ -0,0 +1 @@ +module.exports = "2"; diff --git a/test/watchCases/simple/production/2/changing-module.js b/test/watchCases/simple/production/2/changing-module.js new file mode 100644 index 000000000..bd360e75d --- /dev/null +++ b/test/watchCases/simple/production/2/changing-module.js @@ -0,0 +1 @@ +export default "2"; diff --git a/test/watchCases/simple/production/webpack.config.js b/test/watchCases/simple/production/webpack.config.js new file mode 100644 index 000000000..dffc81bba --- /dev/null +++ b/test/watchCases/simple/production/webpack.config.js @@ -0,0 +1,4 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + mode: "production" +};