Skip to content

Commit 8d67f12

Browse files
authored
update docs (#60)
1 parent 8966805 commit 8d67f12

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/api-documents/configuration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,27 @@ There are 2 useful fields.
7676
- `log`: redirect log message from test cases to unittest framework. It will be showed in failed info.
7777
::: details
7878

79+
as-test.config.js:
80+
81+
```javascript
82+
module.exports = {
83+
imports(runtime) {
84+
return {
85+
env: {
86+
log: (msg) => {
87+
runtime.framework.log(runtime.exports.__getString(msg));
88+
},
89+
},
90+
};
91+
},
92+
}
93+
```
94+
95+
unit test:
96+
7997
```typescript
98+
import { log } from "./env";
99+
80100
test("failed test", () => {
81101
log("This is a log message for the failed test."); // log to be redirect
82102
expect(1 + 1).equal(3);

docs/release-note.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
- 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.
1313
- Support test crashes and provide good call stack information.
1414

15+
Improvements
16+
17+
- Code coverage calculation.
18+
- Skip type definitions.
19+
- Treat switch case correctly.
20+
- Reduced test execution time and memory overhead.
21+
1522
🔄 Arch Changes
1623

1724
- 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.

0 commit comments

Comments
 (0)