Skip to main content

Development workflow

You should think carefully about how you want to use Betterer in your workflow. There is not a perfect "one-size-fits-all" workflow for all teams, but here's a few pointers:

  • You should commit the results file (e.g. .betterer.results) to source control. You should think of this file like a Jest Snapshot file, and review any changes carefully.

  • You should Betterer as part of a build pipeline along with other static analysis tools and tests.

  • If Betterer runs in a pre-commit hook, you must remember to commit any changes to the results file. That might look something like:

yarn betterer && git add .betterer.results
  • You should run Betterer in CI mode (betterer ci) when running on a build server. When Betterer runs in CI mode, it will throw an error when the tests results do not exactly match whatever is in the results file. This ensures that the results file accurately reflects the state of the codebase.