diff --git a/docs/api-documents/configuration.md b/docs/api-documents/configuration.md index 75aef04..a6add87 100644 --- a/docs/api-documents/configuration.md +++ b/docs/api-documents/configuration.md @@ -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); diff --git a/docs/release-note.md b/docs/release-note.md index c187372..fe516a2 100644 --- a/docs/release-note.md +++ b/docs/release-note.md @@ -12,6 +12,13 @@ - 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.