Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(test-utils): fix package name in readme #2338

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/opentelemetry-test-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Since [root hook plugin](https://mochajs.org/#root-hook-plugins) are used, this
1. Add dev dependency on this package:

```sh
npm install @opentelemetry/test-utils --save-dev
npm install @opentelemetry/contrib-test-utils --save-dev
```

1. [`require`](https://mochajs.org/#-require-module-r-module) this package in mocha invocation:
Expand All @@ -37,22 +37,22 @@ As command line argument option to mocha:

```js
"scripts": {
"test": "mocha --require @opentelemetry/test-utils",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha --require @opentelemetry/test-utils",
"test": "mocha --require @opentelemetry/contrib-test-utils",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha --require @opentelemetry/contrib-test-utils",
},
``

Or by using config file / package.json config:
```js
"mocha": {
"require": [ "@opentelemetry/test-utils" ]
"require": [ "@opentelemetry/contrib-test-utils" ]
}
```

1. In your `.spec` file, import `registerInstrumentationTesting` and `getTestSpans` functions and use them to create instrumentation class instance and make assertions in the test:

```js
import { getTestSpans, registerInstrumentationTesting } from '@opentelemetry/test-utils';
import { getTestSpans, registerInstrumentationTesting } from '@opentelemetry/contrib-test-utils';

const instrumentation = registerInstrumentationTesting(new MyAwesomeInstrumentation());

Expand Down