Skip to content

Chore/update doc #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 4, 2025
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
20 changes: 20 additions & 0 deletions docs/api-documents/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,27 @@ There are 2 useful fields.
- `log`: redirect log message from test cases to unittest framework. It will be showed in failed info.
::: details

as-test.config.js:

```javascript
module.exports = {
imports(runtime) {
return {
env: {
log: (msg) => {
runtime.framework.log(runtime.exports.__getString(msg));
},
},
};
},
}
```

unit test:

```typescript
import { log } from "./env";

test("failed test", () => {
log("This is a log message for the failed test."); // log to be redirect
expect(1 + 1).equal(3);
Expand Down
8 changes: 8 additions & 0 deletions docs/release-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@
- Deprecate `--testcase`, replace with `--testFiles`.
- Add `--testNamePattern <name pattern regex>`.
- Add `--onlyFailures` flag to re-run last failed test cases.
- Deprecate `endTest()`.
- Provides clearer log for user.
- Expose the framework's `log` function in the configuration file, and the logs redirected to this function will be appended to the final test report.
- Support test crashes and provide good call stack information.

Improvements

- Code coverage calculation.
- Skip type definitions.
- Treat switch case correctly.
- Reduced test execution time and memory overhead.

🔄 Arch Changes

- During testing, the framework will execute all `test` functions once, but will not trigger callbacks, thereby collecting all test cases and then executing the test cases in sequence.
Expand Down