mops test
Mops can run Motoko unit tests
mops test
Put your tests in test/*.test.mo
files.
All tests run as quickly as possible thanks to parallel execution.
See test package to help you write tests.
Options
--reporter
, -r
Test reporter.
--reporter <reporter>
Available reporters:
verbose
- print each test name (default)files
- print only test filescompact
- pretty progress barsilent
- print only errors
--watch
, -w
Re-run tests every time you change *.mo files.
--watch
--mode
Test run mode
--mode <mode>
Available modes:
interpreter
- run tests viamoc -r
(default)wasi
- compile test file to wasm and execute it withwasmtime
. Useful, when you useto_candid
/from_candid
, or if you get stackoverflow errors.
You can also specify wasi
mode for a specific test file by adding the line below as the first line in the test file
// @testmode wasi