Skip to content

Commit 89bf57f

Browse files
authored
break: remove --testcase CLI option (#94)
1 parent 528633d commit 89bf57f

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

bin/cli.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ program
2020
.option("--coverageLimit [error warning...]", "set warn(yellow) and error(red) upper limit in coverage report")
2121
.option("--collectCoverage <boolean>", "whether to collect coverage information and report")
2222

23-
.option("--testcase <testcases...>", "run only specified test cases deprecated, use --testFiles instead")
2423
.option("--testFiles <testFiles...>", "run only specified test files")
2524
.option("--testNamePattern <test name pattern>", "run only tests with a name that matches the regex pattern")
2625
.option("--onlyFailures", "Run tests that failed in the previous")
@@ -49,15 +48,7 @@ if (includes === undefined) {
4948
const excludes = config.exclude || [];
5049
validateArgument(includes, excludes);
5150

52-
if (options.testcase !== undefined) {
53-
console.log(
54-
chalk.yellowBright(
55-
"Warning: --testcase is deprecated, please use --testFiles instead, --testcase will be removed in next versions"
56-
)
57-
);
58-
}
59-
const testFiles = options.testFiles || options.testcase;
60-
51+
const testFiles = options.testFiles ?? null;
6152
const onlyFailures = options.onlyFailures || false;
6253
const testNamePattern = options.testNamePattern ?? null;
6354

@@ -70,7 +61,7 @@ if (onlyFailures && testNamePattern !== null) {
7061
const collectCoverage =
7162
Boolean(options.collectCoverage) ||
7263
config.collectCoverage ||
73-
(testFiles === undefined && options.testNamePattern === undefined && !onlyFailures);
64+
(testFiles === null && options.testNamePattern === undefined && !onlyFailures);
7465

7566
const getBoolean = (optionValue, configValue) => {
7667
if (optionValue !== undefined) {

docs/release-note.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Remove deprecated `endTest` API.
88
- Changed the default value of `isolated` from `true` to `false`.
9+
- Remove deprecated `--testcase` CLI option.
910

1011
🛠️ Improvements
1112

src/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export interface TestOption {
191191
excludes: string[];
192192
entryFiles: string[] | null;
193193

194-
testFiles: string[] | undefined;
194+
testFiles: string[] | null;
195195
testNamePattern: string | null;
196196
collectCoverage: boolean;
197197
onlyFailures: boolean;

tests/ts/test/core/analyze.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("entry files", () => {
66
{
77
includes: ["tests/ts/fixture/src"],
88
excludes: [],
9-
testFiles: undefined,
9+
testFiles: null,
1010
testNamePattern: null,
1111
entryFiles: ["tests/ts/fixture/src/main.ts"],
1212
},
@@ -19,7 +19,7 @@ describe("entry files", () => {
1919
{
2020
includes: ["tests/ts/fixture/src"],
2121
excludes: [],
22-
testFiles: undefined,
22+
testFiles: null,
2323
testNamePattern: null,
2424
entryFiles: [],
2525
},
@@ -32,7 +32,7 @@ describe("entry files", () => {
3232
{
3333
includes: ["tests/ts/fixture/src"],
3434
excludes: [],
35-
testFiles: undefined,
35+
testFiles: null,
3636
testNamePattern: null,
3737
entryFiles: null,
3838
},

0 commit comments

Comments
 (0)