Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ program
.option("--coverageLimit [error warning...]", "set warn(yellow) and error(red) upper limit in coverage report")
.option("--collectCoverage <boolean>", "whether to collect coverage information and report")

.option("--testcase <testcases...>", "run only specified test cases deprecated, use --testFiles instead")
.option("--testFiles <testFiles...>", "run only specified test files")
.option("--testNamePattern <test name pattern>", "run only tests with a name that matches the regex pattern")
.option("--onlyFailures", "Run tests that failed in the previous")
Expand Down Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions docs/release-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
🔄 Break Changes

- Changed the default value of `isolated` from `true` to `false`.
- Remove deprecated `--testcase` CLI option.

🛠️ Improvements

Expand Down
2 changes: 1 addition & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tests/ts/test/core/analyze.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand All @@ -19,7 +19,7 @@ describe("entry files", () => {
{
includes: ["tests/ts/fixture/src"],
excludes: [],
testFiles: undefined,
testFiles: null,
testNamePattern: null,
entryFiles: [],
},
Expand All @@ -32,7 +32,7 @@ describe("entry files", () => {
{
includes: ["tests/ts/fixture/src"],
excludes: [],
testFiles: undefined,
testFiles: null,
testNamePattern: null,
entryFiles: null,
},
Expand Down