When typing testjs in a terminal, tests/suite.js will be run. Also supports running runners:
testjs tests/run.js or custom / other unit tests under the condition that the runner (here: run.js) does not export
anything. If it does, whatever it exports will be run.
Interoperability
test.js is partially interoperable with nodeunit. There is no setUp/tearDown however and there are no aliases for
things like equal, which is for example aliased as equals in nodeunit. However, test.js including dependencies is
about 100kb while nodeunit is about 16mb.
Command line options
Option
Function
--nocolors or -nc
Disables terminal colors.
--name=NAME or -n=NAME
Sets the suite name. Defaults to the name defined in package.json which is looked up inside of the current working directory or to the base name of the suite file if there is no package.json. The hard coded default is suite.
--silent or -s
Does not produce any output.
Always returns the number of failed tests as the status code.