diff --git a/bin/cli.js b/bin/cli.js index 7bfc9fb..f589d7c 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -80,15 +80,7 @@ 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" - ) - ); -} -// 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/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 ``` 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 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); }