Skip to content

Commit 0bb917b

Browse files
committed
convert to a config test cases
1 parent a39d6b0 commit 0bb917b

File tree

12 files changed

+19
-41
lines changed

12 files changed

+19
-41
lines changed

test/__snapshots__/StatsTestCases.test.js.snap

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,39 +2854,3 @@ WARNING in UglifyJs Plugin: Dropping unused function someUnRemoteUsedFunction4 [
28542854
28552855
WARNING in UglifyJs Plugin: Dropping unused function someUnRemoteUsedFunction5 [./a.js:7,0] in bundle.js"
28562856
`;
2857-
2858-
exports[`StatsTestCases should print correct stats for wasm-in-initial-chunk-error 1`] = `
2859-
"Hash: 9f32353d97d5973caae9
2860-
Time: Xms
2861-
Built at: Thu Jan 01 1970 00:00:00 GMT
2862-
Asset Size Chunks Chunk Names
2863-
0.js 130 bytes 0
2864-
main.js 9.54 KiB 1 main
2865-
Entrypoint main = main.js
2866-
[0] ./wasm.wat 42 bytes {1} [built]
2867-
[1] ./module2.js 45 bytes {1} [built]
2868-
[2] ./module3.js 47 bytes {1} [built]
2869-
[3] ./wasm2.wat 42 bytes {1} [built]
2870-
[4] ./index.js + 1 modules 124 bytes {1} [built]
2871-
| ./index.js 19 bytes [built]
2872-
| ./module.js 100 bytes [built]
2873-
[5] ./async.js 0 bytes {0} [built]
2874-
2875-
WARNING in configuration
2876-
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
2877-
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
2878-
2879-
ERROR in ./wasm2.wat
2880-
WebAssembly module is included in initial chunk.
2881-
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
2882-
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:
2883-
* ./index.js --> ./module.js --> ./module2.js --> ./module3.js --> ./wasm2.wat
2884-
2885-
ERROR in ./wasm.wat
2886-
WebAssembly module is included in initial chunk.
2887-
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
2888-
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:
2889-
* ./index.js --> ./module.js --> ./wasm.wat
2890-
* ... --> ./module.js --> ./module2.js --> ./wasm.wat
2891-
* ... --> ./module2.js --> ./module3.js --> ./wasm.wat"
2892-
`;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = [
2+
[
3+
/\.\/wasm.wat/,
4+
/WebAssembly module is included in initial chunk/,
5+
/\* \.\/index.js --> \.\/module.js --> \.\/wasm.wat/,
6+
/\* \.\.\. --> \.\/module.js --> \.\/module2.js --> \.\/wasm.wat/,
7+
/\* \.\.\. --> \.\/module2.js --> \.\/module3.js --> \.\/wasm.wat/
8+
],
9+
[
10+
/\.\/wasm2\.wat/,
11+
/WebAssembly module is included in initial chunk/,
12+
/\* \.\/index.js --> \.\/module.js --> \.\/module2.js --> \.\/module3.js --> \.\/wasm2.wat/
13+
]
14+
];
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
2+
3+
module.exports = function() {
4+
return supportsWebAssembly();
5+
};

0 commit comments

Comments
 (0)