Skip to main content

Workflow

There is not a perfect "one-size-fits-all" workflow for all teams, but here's a few recommendations:

  • 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 run Betterer in Pre-commit mode (betterer precommit) as a pre-commit hook - perhaps using husky and lint-staged.

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

  • 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.

  • You should let Betterer resolve merge conflicts in the results file for you. You can run betterer merge when you have a conflict and Betterer will fix them for you.