-
-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): display the error which is thrown by the plugin during the …
…starting of `rspack serve` (#8244)
- Loading branch information
1 parent
df8ca34
commit a901d54
Showing
3 changed files
with
29 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
13 changes: 13 additions & 0 deletions
13
packages/rspack-cli/tests/serve/plugin-apply-error/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,13 @@ | ||
module.exports = { | ||
mode: "development", | ||
devtool: false, | ||
plugins: [ | ||
{ | ||
name: "test-plugin", | ||
apply(compiler) { | ||
throw new Error("error in plugin"); | ||
} | ||
} | ||
], | ||
devServer: {} | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/rspack-cli/tests/serve/plugin-apply-error/serve-plugin-apply-error.test.ts
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,11 @@ | ||
import { normalizeStderr, runWatch } from "../../utils/test-utils"; | ||
|
||
describe("should display plugin error", () => { | ||
it("display error", async () => { | ||
const { stderr } = await runWatch(__dirname, ["serve"], { | ||
killString: /Error: / | ||
}); | ||
|
||
expect(normalizeStderr(stderr)).toContain("error in plugin"); | ||
}); | ||
}); |
a901d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
a901d54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open