Skip to content

Commit b58e804

Browse files
authored
feat: support warpo (#102)
1 parent 888ad5d commit b58e804

File tree

21 files changed

+511
-352
lines changed

21 files changed

+511
-352
lines changed

as-test.config.warpo.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import config from "./as-test.config.js";
2+
3+
/**
4+
* @type {import("./config.d.ts").Config}
5+
*/
6+
export default { ...config, warpo: true };

bin/cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ const isolatedInConfig = getBoolean(options.isolated, config.isolated);
8080
const isolated = isolatedInConfig ?? false;
8181

8282
const entryFiles = config.entryFiles ?? null;
83+
const warpo = config.warpo ?? false;
84+
if (warpo) {
85+
console.log(chalk.gray("using warpo"));
86+
} else {
87+
console.log(chalk.gray("using asc"));
88+
}
8389

8490
/**
8591
* @type {import("../dist/interface.d.ts").TestOption}
@@ -104,6 +110,7 @@ const testOption = {
104110
errorLimit: Number(options.coverageLimit?.at(0)),
105111

106112
isolated,
113+
warpo,
107114
};
108115

109116
start_unit_test(testOption)

config.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ export declare class Config {
2828

2929
/** output report mode, default is "table" */
3030
mode?: OutputMode | OutputMode[];
31+
32+
/** whether to build with warpo */
33+
warpo?: boolean;
3134
}

docs/quick-start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Finally, run `npm run test` and as-test will print this message:
6464
6565
(node:144985) ExperimentalWarning: WASI is an experimental feature and might change at any time
6666
(Use `node --trace-warnings ...` to show where the warning was created)
67+
using asc
6768
code analysis: OK
6869
compile test files: OK
6970
instrument: OK

0 commit comments

Comments
 (0)