-
Notifications
You must be signed in to change notification settings - Fork 306
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
[ci-visibility] Fix EFD with jest and jsdom #4323
Conversation
Overall package sizeSelf size: 6.48 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2024-05-20 07:23:24 Comparing candidate commit 500d592 in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 259 metrics, 5 unstable metrics. scenario:plugin-graphql-with-depth-and-collapse-on-18
scenario:plugin-graphql-with-depth-on-max-18
|
What does this PR do?
Fix EFD retry mechanism that was failing in jest when using
jsdom
. The problem:this.context
is only defined for node jest environment, not jsdom. You need to usegetVmContext
instead.See how
this.context
is accessible injest-environment-node
: https://github.com/jestjs/jest/blob/559449e5a0a87210324720b56caa55b2e0ad3c94/packages/jest-environment-node/src/index.ts#L219See how
this.context
is not accessible injest-environment-jsdom
:https://github.com/jestjs/jest/blob/559449e5a0a87210324720b56caa55b2e0ad3c94/packages/jest-environment-jsdom-abstract/src/index.ts#L187
Motivation
Fix retry mechanism in jest when using
jsdom
.This was not caught earlier because we were not testing with
jsdom
. I've fixed that.Plugin Checklist