Build and Test with WARPO CLI
The WARPO CLI now provides project-oriented subcommands for the common local workflow:
npx warpo buildbuilds the current project.npx warpo testruns the WARPO unit test runner.
These commands are the recommended entry points when you are working inside a WARPO project.
Build a Project
npx warpo build forwards all extra arguments to the compiler and adds a few project-friendly defaults:
- If
asconfig.jsonexists in the current directory and--configis not passed, WARPO uses it automatically. - If
create.tsexists in the current directory and--projectis not passed, WARPO enables project mode automatically.
Typical asconfig.json:
{
"entries": ["assembly/index.ts"],
"targets": {
"debug": {
"debug": true,
"sourceMap": true
},
"release": {
"optimizeLevel": 3,
"shrinkLevel": 2
}
}
}Common commands:
npx warpo build
npx warpo build --target debug
npx warpo build --target release
npx warpo build --config ./configs/asconfig.json --target releaseThe legacy direct form is still supported:
npx warpo assembly/index.ts -o build/debug.watRun Unit Tests
npx warpo test runs WARPO's test runner. It is integrated from assemblyscript-unittest-framework, so the test layout, as-test.config.js file, and common assertion style follow the same model. By default it looks for as-test.config.js in the current directory. Use --config if your test config lives somewhere else.
If you are new to this testing workflow, start with the framework's quick start. WARPO's test subcommand is the WARPO-integrated entry point for that test system.
Typical as-test.config.js:
export default {
include: ["tests/assemblyscript/**/*.ts"],
collectCoverage: false,
output: "build_coverage",
};Common commands:
npx warpo test
npx warpo test --testFiles tests/assemblyscript/add.spec.ts
npx warpo test --testNamePattern add
npx warpo test --onlyFailures
npx warpo test --collectCoverage true --mode html --output build_coverageNotes:
--testFilesruns only the listed test files.--testNamePatternfilters test cases by regular expression.--onlyFailuresreruns the tests that failed previously.- When you filter tests with
--testFiles,--testNamePattern, or--onlyFailures, coverage collection is disabled by default unless you enable it explicitly.