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
.asserted directory with all the necessary asserted dependencies and configuration:
.asserted, you'll find:
routine.json ## Routine configuration with interval and mocha configpackage.json ## NPM package defining the (currently) fixed set of dependencies available during testingexamples/ ## 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.
This will push the current version of the code to asserted.io and you should start seeing results in the dashboard within a few seconds.
Once you have a routine running, you'll want to know if it detects any errors.
Go to the settings page of that routine within asserted.io to add a notification configuration.
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
.asserted directory and they'll be included in the next push.
By default, Mocha will run any files with the
.asrtd.js suffix as tests. Though this can be configured inside the
To run tests locally, you can use:
The results will look something like:
In the event that you have an issue that only seems to manifest when run online, you can use the following option to run the test inside asserted.io:
asrtd run --online