Installation
Prerequisites
You need at least Node.js v12 to install and run Betterer.
Adding Betterer to your project
The easiest way to get up and running with Betterer is to use the init script via npx:
# Run this from the root of your project:
npx @betterer/cli init
Running this command will:
- Add
@betterer/clias adevDependencyto yourpackage.json - Add a
bettererscript to yourpackage.json - Create a blank
.betterer.tsfile in the root of your project
caution
Running npx @betterer/cli init will modify your project's package.json file, so you probably want to make sure all your changes are saved first!
Init Options
You can pass the following options to the init script:
| Option | Description | Default |
|---|---|---|
--automerge | Enable automatic merging for the Betterer results file | false |
-c, --config [path] | Path to test definition file relative to CWD | ./.betterer.ts |
-r, --results [value] | Path to test results file relative to CWD | ./.betterer.results |
info
Betterer uses TypeScript by default! If you pass a --config path that ends with .js, JavaScript will be used instead and TypeScript will not be installed.
Read more about Init
Installing Betterer dependencies
You'll need to install the new dependency with your package manager of choice:
- Yarn
- npm
Run yarn to install @betterer/cli
Run npm install to install @betterer/cli
That's it!
You're all ready to go! 🎉