Skip to content

Commit 08c8723

Browse files
refactor: restore logic
1 parent aa34a14 commit 08c8723

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

packages/webpack-cli/src/webpack-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ class WebpackCLI {
878878
const optionForCommand = new Option(mainOption.flags, mainOption.description);
879879

880880
// Hide stub option
881-
optionForCommand.flags = "";
881+
// TODO find a solution to hide such options in the new commander version, for example `--performance` and `--no-performance` because we don't have `--performance` at all
882882
optionForCommand.hidden = option.hidden || true;
883883
(optionForCommand as Option & { internal?: boolean }).internal = true;
884884

test/build/core-flags/core-flags.test.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe("core flags", () => {
108108
const { exitCode, stderr, stdout } = await run(__dirname, ["--amd"]);
109109

110110
expect(exitCode).toBe(2);
111-
expect(stderr).toContain("Unknown option '--amd");
111+
expect(stderr).toContain("Invalid value 'true' for the '--amd' option");
112112
expect(stdout).toBeFalsy();
113113
});
114114

@@ -195,24 +195,6 @@ describe("core flags", () => {
195195
});
196196
});
197197

198-
describe("only negative flags", () => {
199-
it("should throw an error on set performance to true", async () => {
200-
const { exitCode, stderr, stdout } = await run(__dirname, ["--performance"]);
201-
202-
expect(exitCode).toBe(2);
203-
expect(stderr).toContain("Unknown option '--performance'");
204-
expect(stdout).toBeFalsy();
205-
});
206-
207-
it("should set performance to false", async () => {
208-
const { exitCode, stderr, stdout } = await run(__dirname, ["--no-performance"]);
209-
210-
expect(exitCode).toBe(0);
211-
expect(stderr).toBeFalsy();
212-
expect(stdout).toContain("performance: false");
213-
});
214-
});
215-
216198
describe("flags with multiple types", () => {
217199
it("should allow string value for `infrastructureLogging.debug`", async () => {
218200
const { exitCode, stderr, stdout } = await run(__dirname, [

0 commit comments

Comments
 (0)