From ac4abbea33968d59a783fd5e60256838e1098db4 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 27 Oct 2025 15:27:44 +0800 Subject: [PATCH 1/3] break: switch default value of isolated from true to false --- bin/cli.js | 3 +-- docs/release-note.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index 7bfc9fb..8386e95 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -87,8 +87,7 @@ if (isolatedInConfig === undefined) { ) ); } -// TODO: switch to false default in 2.x -const isolated = isolatedInConfig ?? true; +const isolated = isolatedInConfig ?? false; /** * @type {import("../dist/interface.d.ts").TestOption} diff --git a/docs/release-note.md b/docs/release-note.md index cfa4643..541aa7d 100644 --- a/docs/release-note.md +++ b/docs/release-note.md @@ -1,5 +1,17 @@ # Release Note +## 2.0.0 + +🔄 Break Changes + +- Changed the default value of `isolated` from `true` to `false`. + +## 1.4.1 + +🚀 Highlight Features + +- Supported windows officially. + ## 1.4.0 🚀 Highlight Features From 1154c8646fff44fefd4fb292c03a65617e8eca2e Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 27 Oct 2025 15:35:55 +0800 Subject: [PATCH 2/3] fix --- bin/cli.js | 7 ------- docs/api-documents/options.md | 17 +++++++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index 8386e95..f589d7c 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -80,13 +80,6 @@ const getBoolean = (optionValue, configValue) => { return undefined; }; const isolatedInConfig = getBoolean(options.isolated, config.isolated); -if (isolatedInConfig === undefined) { - console.warn( - chalk.yellowBright( - "Warning: In the next version, the default value of isolated will change. Please specify isolated in config" - ) - ); -} const isolated = isolatedInConfig ?? false; /** diff --git a/docs/api-documents/options.md b/docs/api-documents/options.md index 77c08ef..fcf076c 100644 --- a/docs/api-documents/options.md +++ b/docs/api-documents/options.md @@ -88,7 +88,6 @@ run `as-test --testNamePattern "groupA case_\d"` will run `case_1`, `case_2`, `c ::: tip The framework join `DescriptionName` and `TestName` with `" "` by default, e.g. `groupA case_1` is the full test case name of `case_1`. - ::: #### Run only failures @@ -107,21 +106,27 @@ You can control the coverage collection manually with `--collectCoverage` option ### Isolated Execution -Isolated test execution helps isolate error propagation between different test scenarios and reduces the burden of restoring context, which is very helpful for rapid technical verification. +Isolated test execution helps isolate error propagation between different test scenarios and reduces the burden of restoring context, which is very helpful for rapid technical verification. However, as the project scales, isolated test execution will compile the source code multiple times, slowing down overall test performance. In this case, restoring the context in code and disabling the `isolated` option after testing can reduce test time. -However, as the project scales, isolated test execution will compile the source code multiple times, slowing down overall test performance. In this case, restoring the context in code and disabling the `isolated` option after testing can help reduce test time. +::: tip +In version 1.4.x, isolated is enabled by default. +After version 2.x, isolated is disabled by default. +::: -- disable by config: +- enable/disable by config: ```js { - // ... + // enable + isolated: true + // disable isolated: false } ``` -- disable by cli +- enable/disable by cli ```bash + npx as-test ... --isolated true npx as-test ... --isolated false ``` From 5e61532ee9887455c77bf8a1e11f8f7978485e99 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Mon, 27 Oct 2025 15:37:49 +0800 Subject: [PATCH 3/3] fix --- tests/e2e/assertFailed/as-test.config.js | 4 ++++ tests/e2e/run.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/assertFailed/as-test.config.js b/tests/e2e/assertFailed/as-test.config.js index 48c78b0..7cccc78 100644 --- a/tests/e2e/assertFailed/as-test.config.js +++ b/tests/e2e/assertFailed/as-test.config.js @@ -2,8 +2,12 @@ import path from "node:path"; const __dirname = path.dirname(new URL(import.meta.url).pathname); +/** + * @type {import("../../../config.d.ts").Config} + */ export default { include: [__dirname], + isolated: true, imports(runtime) { return { env: { diff --git a/tests/e2e/run.js b/tests/e2e/run.js index 7b15221..a44db92 100644 --- a/tests/e2e/run.js +++ b/tests/e2e/run.js @@ -35,9 +35,9 @@ function runEndToEndTest(name, flags, handle) { // standard check const expectStdOut = readFileSync(`tests/e2e/${name}/stdout.txt`, "utf-8"); if (expectStdOut !== stdout) { - console.log(`=========STDOUT ${name}=========`); + console.log(`========= STDOUT ${name} =========`); console.log(getDiff(expectStdOut, stdout)); - console.log(`=========STDERR ${name}=========`); + console.log(`========= STDERR ${name} =========`); console.log(stderr); process.exit(1); }