Skip to main content
Baserun offers a jest preset, which will automatically add the beforeAll to your test file and turn all it and test calls into baserun.trace calls.

Setup

There is no particular change needed in your actual tests, just add the --preset baserun flag to your jest command.
test_module.spec.ts

Running multiple tests

It’s often helpful to exercise the same test over multiple examples. To do this, we suggest doing a simple for loop to autogenerate your tests and for larger numbers of examples you can read from a file or other data structure.
my-test.test.ts

Existing presets

If you are already using a Jest preset such as ts-jest you will need to merge the presets in a Jest config

Naming

Baserun lets you compare test results and debug each step side by side. We consider the full path of the describe and it names of the jest test as a unique identifier for the test. In the example above, two tests would be run and identified by ("Baserun end-to-end", "should suggest the Eiffel Tower") and ("Baserun end-to-end", "should suggest the Colosseum")

Automatic evaluations

Evaluate tests’ outputs.