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
10 changes: 1 addition & 9 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
17 changes: 11 additions & 6 deletions docs/api-documents/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
12 changes: 12 additions & 0 deletions docs/release-note.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/assertFailed/as-test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down