Home

Awesome

<p align="center"> <a href="https://www.traceloop.com/"> <img width="300" src="https://raw.githubusercontent.com/traceloop/jest-opentelemetry/main/img/logo.png"> </a> </p> <h1 align="center">Jest OpenTelemetry</h1> <p align="center"> <p align="center">Integeration tests with 10 lines of code</p> </p> <h4 align="center"> <a href="https://traceloop.com/docs/jest-otel/getting-started"><strong>Get started ยป</strong></a> <br /> <br /> <a href="https://join.slack.com/t/traceloopcommunity/shared_invite/zt-1plpfpm6r-zOHKI028VkpcWdobX65C~g">Slack</a> | <a href="https://traceloop.com/docs/jest-otel/introduction">Docs</a> | <a href="https://traceloop.com/docs/jest-otel/syntax/overview">Examples</a> | <a href="https://www.traceloop.com">Website</a> </h4> <h4 align="center"> <a href="https://github.com/traceloop/jest-opentelemetry/blob/main/LICENSE"> <img src="https://img.shields.io/badge/license-Apache 2.0-blue.svg" alt="Jest OpenTelemetry is released under the Apache-2.0 License"> </a> <a href="https://www.ycombinator.com/companies/traceloop"><img src="https://img.shields.io/website?color=%23f26522&down_message=Y%20Combinator&label=Backed&logo=ycombinator&style=flat-square&up_message=Y%20Combinator&url=https%3A%2F%2Fwww.ycombinator.com"></a> <a href="https://github.com/traceloop/jest-opentelemetry/blob/main/CONTRIBUTING.md"> <img src="https://img.shields.io/badge/PRs-Welcome-brightgreen" alt="PRs welcome!" /> </a> <a href="https://github.com/traceloop/jest-opentelemetry/issues"> <img src="https://img.shields.io/github/commit-activity/m/traceloop/jest-opentelemetry" alt="git commit activity" /> </a> <a href="https://join.slack.com/t/traceloopcommunity/shared_invite/zt-1plpfpm6r-zOHKI028VkpcWdobX65C~g"> <img src="https://img.shields.io/badge/chat-on%20Slack-blueviolet" alt="Slack community channel" /> </a> <a href="https://twitter.com/traceloopdev"> <img src="https://img.shields.io/badge/follow-%40traceloopdev-1DA1F2?logo=twitter&style=social" alt="Traceloop Twitter" /> </a> </h4>

Jest OpenTelemetry allows you to write, build and run integration tests based on OpenTelemetry traces with Jest-like syntax. You can:

All with just a few lines of code.

It's built and maintained by Traceloop under the Apache 2.0 license.

๐Ÿš€ Getting Started

npm i --save-dev @traceloop/jest-opentelemetry

Then, you can start testing your microservices:

const traceloop = new TraceLoop();

await traceloop.axiosInstance.post('http://my.awesome.website/orders/create');
await traceloop.fetchTraces();

expectTrace(traceloop.serviceByName('emails-service'))
  .toReceiveHttpRequest()
  .ofMethod('POST')
  .withBody({ emailTemplate: 'orderCreated', itemId: '123' });

More info can be found in our docs.

What can you test?

Jest OpenTelemetry can be used to test anything that's happening in your system. We're constantly adding more, and you're welcome to suggest yours.

Service Assertions

Database Assertions

Analytics Reporting Assertions

External Systems Assertions

๐ŸŒฑ Contributing

Whether it's big or small, we love contributions โค๏ธ Check out our guide to see how to get started.

Not sure where to get started? You can:

๐Ÿ’š Community & Support