@dagger.io/jest
v0.3.3
Published
Jest Test Runner with Open telemetry support for auto-instrumentation with dagger
Readme
Jest OpenTelemetry auto instruentation
Automatically instrument Jest tests for open telemetry.
Installation
Install @dagger.io/jest in your project
npm install @dagger.io/jestSetup
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
"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:
testEnvironment: "@dagger.io/jest/node-environment"