Jest Test Runner with Open telemetry support for auto-instrumentation with dagger
npm install @dagger.io/jestAutomatically instrument Jest tests for open telemetry.
Install @dagger.io/jest in your project
``shell`
npm install @dagger.io/jest
You can either follow a no-configuration setup or update your current jest.config.js file.
#### No configuration setup
Add the following import in your NODE_OPTIONS to auto-instrument when running your test
`shell`
"NODE_OPTIONS=\"$NODE_OPTIONS --require @dagger.io/jest/register \" jest
:bulb: If your project is in ESM, make sure you first followed ECMAScript Module setup on Jest
#### Jest config setup
:warning: This setup may not work if you already have custom environment, if so please follow the
no configuration setup that can take any environment.
The library export an environment that you can use to automatically instrument your tests:
`json``
testEnvironment: "@dagger.io/jest/node-environment"