-
-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/rspack-test-tools/tests/watchCases/module-ids/ignored-module/0/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
|
||
it("should compile", () => { | ||
expect(true).toBe(true); | ||
}); | ||
|
||
it("should have correct log when incremental enabled", async () => { | ||
const statsString = await fs.readFile(path.resolve(__dirname, `stats.${WATCH_STEP}.txt`), 'utf-8'); | ||
const incrementalLog = /LOG from rspack\.incremental\.moduleIds[\s\S]*?LOG/.exec(statsString); | ||
if (incrementalLog) { | ||
const content = incrementalLog[0]; | ||
expect(content.includes("with 0 unnamed modules")).toBe(true); | ||
} | ||
}); |
16 changes: 16 additions & 0 deletions
16
packages/rspack-test-tools/tests/watchCases/module-ids/ignored-module/1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
|
||
it("should have correct ignored value", () => { | ||
const ignored = require("ignored"); | ||
expect(ignored).toEqual({}); | ||
}); | ||
|
||
it("should have correct log when incremental enabled", async () => { | ||
const statsString = await fs.readFile(path.resolve(__dirname, `stats.${WATCH_STEP}.txt`), 'utf-8'); | ||
const incrementalLog = /LOG from rspack\.incremental\.moduleIds[\s\S]*?LOG/.exec(statsString); | ||
if (incrementalLog) { | ||
const content = incrementalLog[0]; | ||
expect(content.includes("with 0 unnamed modules")).toBe(true); | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/rspack-test-tools/tests/watchCases/module-ids/ignored-module/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('@rspack/core').Configuration} */ | ||
module.exports = { | ||
resolve: { | ||
alias: { | ||
"ignored": false, | ||
}, | ||
} | ||
}; |