diff --git a/bin/cli.js b/bin/cli.js index ae90a17..5584d95 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -20,7 +20,6 @@ program .option("--coverageLimit [error warning...]", "set warn(yellow) and error(red) upper limit in coverage report") .option("--collectCoverage ", "whether to collect coverage information and report") - .option("--testcase ", "run only specified test cases deprecated, use --testFiles instead") .option("--testFiles ", "run only specified test files") .option("--testNamePattern ", "run only tests with a name that matches the regex pattern") .option("--onlyFailures", "Run tests that failed in the previous") @@ -49,15 +48,7 @@ if (includes === undefined) { const excludes = config.exclude || []; validateArgument(includes, excludes); -if (options.testcase !== undefined) { - console.log( - chalk.yellowBright( - "Warning: --testcase is deprecated, please use --testFiles instead, --testcase will be removed in next versions" - ) - ); -} -const testFiles = options.testFiles || options.testcase; - +const testFiles = options.testFiles ?? null; const onlyFailures = options.onlyFailures || false; const testNamePattern = options.testNamePattern ?? null; @@ -70,7 +61,7 @@ if (onlyFailures && testNamePattern !== null) { const collectCoverage = Boolean(options.collectCoverage) || config.collectCoverage || - (testFiles === undefined && options.testNamePattern === undefined && !onlyFailures); + (testFiles === null && options.testNamePattern === undefined && !onlyFailures); const getBoolean = (optionValue, configValue) => { if (optionValue !== undefined) { diff --git a/docs/release-note.md b/docs/release-note.md index 4935c38..57ad521 100644 --- a/docs/release-note.md +++ b/docs/release-note.md @@ -5,6 +5,7 @@ 🔄 Break Changes - Changed the default value of `isolated` from `true` to `false`. +- Remove deprecated `--testcase` CLI option. 🛠️ Improvements diff --git a/src/interface.ts b/src/interface.ts index 54560b0..ad42a5c 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -191,7 +191,7 @@ export interface TestOption { excludes: string[]; entryFiles: string[] | null; - testFiles: string[] | undefined; + testFiles: string[] | null; testNamePattern: string | null; collectCoverage: boolean; onlyFailures: boolean; diff --git a/tests/ts/test/core/analyze.test.ts b/tests/ts/test/core/analyze.test.ts index d2695fb..42b003a 100644 --- a/tests/ts/test/core/analyze.test.ts +++ b/tests/ts/test/core/analyze.test.ts @@ -6,7 +6,7 @@ describe("entry files", () => { { includes: ["tests/ts/fixture/src"], excludes: [], - testFiles: undefined, + testFiles: null, testNamePattern: null, entryFiles: ["tests/ts/fixture/src/main.ts"], }, @@ -19,7 +19,7 @@ describe("entry files", () => { { includes: ["tests/ts/fixture/src"], excludes: [], - testFiles: undefined, + testFiles: null, testNamePattern: null, entryFiles: [], }, @@ -32,7 +32,7 @@ describe("entry files", () => { { includes: ["tests/ts/fixture/src"], excludes: [], - testFiles: undefined, + testFiles: null, testNamePattern: null, entryFiles: null, },