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"
}
}
}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.
ast clean removes build, logs, and coverage outputs from these configured locations. A full ast clean also clears the shared fuzz.crashDir.
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",
"browser": ""
},
"reporter": "default",
"env": {}
}
}The default generated runners are env-driven single-file scripts. Standard runner commands do not need a <file> argument.
Reporter values can be:
"""default""tap"- a custom module path
- an object with
name,options,outDir, andoutFile
Coverage Options
{
"coverage": {
"enabled": true,
"mode": "project",
"dependencies": ["json-as"],
"includeSpecs": false,
"include": [],
"exclude": [],
"ignore": {
"labels": [],
"names": [],
"locations": [],
"snippets": []
}
}
}Notes:
coverage: trueis a shortcut for enabling coverage withmode: "project"modecan be:project: project files onlyall: project files and dependency files
dependenciesis a package-name allowlist for dependency coverage- use names like
json-asor@scope/pkg - this works for both normal installs and
pnpminstalls
- use names like
includeSpecscontrols whether*.spec.tsfiles are eligible for coverageincludeandexcluderefine the final eligible file set aftermode,dependencies, andincludeSpecs- AssemblyScript stdlib files are still excluded
Fuzz Options
{
"fuzz": {
"input": ["./assembly/__fuzz__/*.fuzz.ts"],
"runs": 1000,
"maxInputBytes": 4096,
"target": "bindings",
"corpusDir": "./.as-test/fuzz/corpus",
"crashDir": "./.as-test/crashes"
}
}Notes:
- fuzz builds currently require
target: "bindings" seedis optional; if omitted, each campaign uses a random base seed- failures and crashes are written under
crashDir
Modes
Modes let one project run against multiple targets or runtime commands.
{
"modes": {
"node:wasi": {
"buildOptions": {
"target": "wasi"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.wasi.js"
}
}
},
"node:bindings": {
"buildOptions": {
"target": "bindings"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.bindings.js"
}
}
},
"chromium:headless": {
"default": false,
"buildOptions": {
"target": "web"
},
"runOptions": {
"runtime": {
"cmd": "node ./.as-test/runners/default.web.js --headless",
"browser": "chromium"
}
}
}
}
}Mode entries can override:
- output directories
- coverage config
- build options
- runtime config
- reporter config
- mode-level environment variables
Set default: false on a mode to make it manual-only. When --mode is omitted, modes with default: false are skipped.
When the config declares any modes, only those modes run on an implicit ast test — the unnamed base config is not added on top. If no modes are declared at all, the base config runs by itself. Modes that don't override runOptions inherit the runner from the base config.
ast clean is the exception: when --mode is omitted, it cleans every configured mode regardless of default: false.
When multiple modes are active, output paths are namespaced by mode when needed.
