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

Make dd-trace available within jest tests #2003

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

juan-fernandez
Copy link
Collaborator

What does this PR do?

Make 'dd-trace' available within jest tests. It was not available because tests run in a different global context.

Motivation

Inspired by #2000 - Thanks @mdbenjam !
Fixes #1999

Plugin Checklist

  • Unit tests.

@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #2003 (684e39c) into master (a8cebcc) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #2003      +/-   ##
==========================================
- Coverage   79.94%   79.92%   -0.02%     
==========================================
  Files         199      199              
  Lines        8113     8115       +2     
==========================================
  Hits         6486     6486              
- Misses       1627     1629       +2     
Impacted Files Coverage Δ
packages/datadog-instrumentations/src/jest.js 18.51% <0.00%> (-0.47%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link

@mdbenjam mdbenjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know all the ins and outs of this code, but this change fixes the issue in my test case and the changes seem reasonable!

@rochdev rochdev added this to the 2.5.1 milestone Apr 20, 2022
@juan-fernandez juan-fernandez merged commit ba7f1e7 into master Apr 21, 2022
@juan-fernandez juan-fernandez deleted the juan-fernandez/ddtrace-available branch April 21, 2022 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests using the Jest plugin cannot access tracing scope
3 participants