Configuration
The config file is as-test.config.json.
The schema file in this repo is as-test.config.schema.json.
Minimal Example
{
"input": ["assembly/__tests__/*.spec.ts"],
"output": ".as-test/",
"buildOptions": {
"target": "wasi"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.wasi.js <file>"
}
}
}Top-Level Fields
Common top-level fields:
inputoutputoutDirlogscoverageDirsnapshotDircoverageenvbuildOptionsrunOptionsfuzzmodes
Output Paths
You can use the older individual path fields, or the newer output alias.
String form:
{
"output": ".as-test/"
}Object form:
{
"output": {
"build": "./.as-test/build",
"logs": "./.as-test/logs",
"coverage": "./.as-test/coverage",
"snapshots": "./.as-test/snapshots"
}
}Legacy explicit fields like outDir, logs, coverageDir, and snapshotDir still work and override the alias when both are present.
Environment Values
env, buildOptions.env, and runOptions.env can each be:
- a
.envfile path - an array of
KEY=valuestrings - an object map
These values merge together, with mode overrides applied on top.
Build Options
{
"buildOptions": {
"target": "wasi",
"args": [],
"cmd": "",
"env": {}
}
}Supported targets:
wasibindingsweb
buildOptions.cmd replaces the default build command path and supports placeholders such as <file>, <name>, <outFile>, <target>, and <mode>.
Run Options
{
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.wasi.js <file>",
"browser": ""
},
"reporter": "default",
"env": {}
}
}Reporter values can be:
"""default""tap"- a custom module path
- an object with
name,options,outDir, andoutFile
Fuzz Options
{
"fuzz": {
"input": ["./assembly/__fuzz__/*.fuzz.ts"],
"runs": 1000,
"seed": 1337,
"maxInputBytes": 4096,
"target": "bindings",
"corpusDir": "./.as-test/fuzz/corpus",
"crashDir": "./.as-test/crashes"
}
}Notes:
- fuzz builds currently require
target: "bindings" seedis the deterministic base seed- failures and crashes are written under
crashDir
Modes
Modes let one project run against multiple targets or runtime commands.
{
"modes": {
"wasi": {
"buildOptions": {
"target": "wasi"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.wasi.js <file>"
}
}
},
"bindings": {
"buildOptions": {
"target": "bindings"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.bindings.js <file>"
}
}
}
}
}Mode entries can override:
- output directories
- coverage config
- build options
- runtime config
- reporter config
- mode-level environment variables
When multiple modes are active, output paths are namespaced by mode when needed.
