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

Use node env in Jest #7032

Merged
merged 1 commit into from
Nov 23, 2018
Merged

Use node env in Jest #7032

merged 1 commit into from
Nov 23, 2018

Conversation

willdurand
Copy link
Member

@willdurand willdurand commented Nov 22, 2018

Fixes mozilla/addons#12713


According to jestjs/jest#1909, we should use node as the test environment. I am not sure what the implications are, but if the test suite passes with that, I guess it is alright.

I saw a similar patch related to webpack 4 too: mxmul/closure-loader#40

I marked the test file for the sriDataPlugin as "requires node", see also: mozilla/addons#10410

@willdurand
Copy link
Member Author

According to facebook/jest#1909, we should use node as the test environment. I am not sure what the implications are, but if the test suite passes with that, I guess it is alright.

I saw a similar patch related to webpack 4 too: mxmul/closure-loader#40

Implications are clear: we have a test suite that requires a "browser" context, in most cases. Yet, tests for a webpack plugin (like the sriDataPlugin) should run in a node context IMO.

@muffinresearch
Copy link
Contributor

/me looks wistfully at mozilla/addons#10410

@willdurand
Copy link
Member Author

willdurand commented Nov 22, 2018

/me looks wistfully at mozilla/addons#10410

There is literally an issue filed from everything 😄

@willdurand
Copy link
Member Author

Second attempt 🚀

@codecov-io
Copy link

codecov-io commented Nov 22, 2018

Codecov Report

Merging #7032 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    mozilla/addons-frontend#7032   +/-   ##
=======================================
  Coverage   97.85%   97.85%           
=======================================
  Files         251      251           
  Lines        6852     6852           
  Branches     1264     1264           
=======================================
  Hits         6705     6705           
  Misses        133      133           
  Partials       14       14

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54180d6...aed57af. Read the comment docs.

@willdurand
Copy link
Member Author

Ok, that looks good!

@willdurand
Copy link
Member Author

Merging this now because that's annoying :/

@willdurand willdurand merged commit 58bbcb7 into master Nov 23, 2018
@willdurand willdurand deleted the fix-test branch November 23, 2018 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants