Instrumenting Mocha tests with Helios

Use the installation instructions below if you're using Mocha as your testing framework and would like to add your existing tests to Helios for complete E2E troubleshooting.

Navigate to your project's root directory, and install the latest Helios OpenTelemetry SDK:

npm install --save helios-opentelemetry-sdk

In your test file, paste the following code snippet before all other imports:

const { instrumentTests } = require('helios-opentelemetry-sdk');

instrumentTests({
    apiToken: <API_TOKEN>,
    environment: <ENVIRONMENT>,  // Defaults to process.env.NODE_ENV if omitted.
});
import { instrumentTests } from 'helios-opentelemetry-sdk';

instrumentTests({
    apiToken: <API_TOKEN>,
    environment: <ENVIRONMENT>,  // Defaults to process.env.NODE_ENV if omitted.
});

๐Ÿ‘

All set

Now when you run your tests - the results will show up in the Helios application and the URL of the exact test trace will be handily printed after each test run.

๐Ÿ’š

Mocha