Skip to main content

Test definition file

All your tests should be exported from a test definition file. By default, Betterer expects this to be .betterer.ts or .betterer.js, but you can change that by using the --config flag when running Betterer.

Default export#

You can expose properties on the default export:

// .betterer.tsexport default {  'my test': {    // ... test config  },  'my other test': {    // ... test config  }};

Constant export#

You can also expose specific named exports:

// .betterer.tsexport const myTest = {  // ... test config};
export const myOtherTest = {  // ... test config};
info

You can also define your tests in other files and then re-export them from the test definition file! If you write a test that would be useful for others, please publish it as a package!