Start testing in prod
The asserted CLI requires at least Node v10. Check which version of Node you have installed with:
If you do not have Node installed, or have the wrong version, we recommend installing Node using one of the following:
Use NPM to globally install the asserted CLI:
npm i -g asrtd
At any time you can run the following to get a full breakdown of all CLI commands:
Login to the CLI with:
This will open a browser to Token Management so you can create a token and paste it into the interactive prompt. Tokens are associated with the user, not the project, and take on all of the abilities of that user.
Usually routines are associated with a specific git repo or project. Move to the directory where you want to create the test files associated with a routine.
Run the following command to create a
.asserteddirectory with all the necessary asserted dependencies and configuration:
.asserted, you'll find:
routine.json ## Routine configuration with interval and mocha config
package.json ## NPM package defining the (currently) fixed set of dependencies available during testing
examples/ ## Directory containing examples, can be modified or removed
Your routine is now configured, but only contains examples. To get an idea of how everything works, lets push the current version with the examples.
Once you have a routine running, you'll want to know if it detects any errors.
You can be notified by email or Slack webhook, or by phone if you have a paid plan or have purchased extra SMS.
From here on out, it works mostly like writing any other Mocha test. The free plans only have a fixed set of dependencies, but the paid plans can include any dependencies you wish. Check out Dependencies for more on that.
You can create whatever tests or files you'd like inside the
.asserteddirectory and they'll be included in the next push.
By default, Mocha will run any files with the
.asrtd.jssuffix as tests. Though this can be configured inside the
To run tests locally, you can use:
The results will look something like:
Local run result
asrtd run --online