Skip to content

Commit

Permalink
test: add nwjs external preset test
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoyun committed Jun 25, 2024
1 parent ed7bca9 commit 2840cc8
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions packages/rspack-test-tools/tests/defaultsCases/target_/nwjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/** @type {import('../../..').TDefaultsCaseConfig} */
module.exports = {
description: "target nwjs",
options: () => ({ target: "nwjs" }),
diff: e =>
e.toMatchInlineSnapshot(`
- Expected
+ Received
@@ ... @@
- "node": false,
- "nwjs": false,
+ "node": true,
+ "nwjs": true,
@@ ... @@
- "document": true,
+ "document": false,
@@ ... @@
- "target": "web",
+ "target": "nwjs",
@@ ... @@
- "exportsOnly": false,
+ "exportsOnly": true,
@@ ... @@
- "exportsOnly": false,
+ "exportsOnly": true,
@@ ... @@
- "exportsOnly": false,
+ "exportsOnly": true,
@@ ... @@
- "__dirname": "warn-mock",
- "__filename": "warn-mock",
- "global": "warn",
+ "__dirname": "eval-only",
+ "__filename": "eval-only",
+ "global": false,
@@ ... @@
- "chunkFormat": "array-push",
- "chunkLoading": "jsonp",
+ "chunkFormat": "commonjs",
+ "chunkLoading": "async-node",
@@ ... @@
- "jsonp",
- "import-scripts",
+ "async-node",
@@ ... @@
- "fetch",
+ "async-node",
@@ ... @@
- "document": true,
+ "document": false,
@@ ... @@
- "globalObject": "self",
+ "globalObject": "global",
@@ ... @@
- "publicPath": "auto",
+ "publicPath": "",
@@ ... @@
- "wasmLoading": "fetch",
+ "wasmLoading": "async-node",
@@ ... @@
- "workerChunkLoading": "import-scripts",
+ "workerChunkLoading": "async-node",
@@ ... @@
- "workerWasmLoading": "fetch",
+ "workerWasmLoading": "async-node",
@@ ... @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ ... @@
- "browser",
@@ ... @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ ... @@
- "browser",
@@ ... @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ ... @@
- "browser",
@@ ... @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ ... @@
- "browser",
@@ ... @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ ... @@
- "browser",
@@ ... @@
+ "node",
@@ ... @@
+ "nwjs",
@@ ... @@
- "target": "web",
+ "target": "nwjs",
`)
};

0 comments on commit 2840cc8

Please sign in to comment.