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

Unit tests fail under node 6.10.1 #4471

Closed
jfirebaugh opened this issue Mar 22, 2017 · 3 comments
Closed

Unit tests fail under node 6.10.1 #4471

jfirebaugh opened this issue Mar 22, 2017 · 3 comments

Comments

@jfirebaugh
Copy link
Contributor

Unit tests which pass under 6.10.0 are failing on node 6.10.1, released today. The first failing test is:

  1) test/unit/source/canvas_source.test.js CanvasSource rerenders if animated window.useFakeHTMLCanvasGetContext is not a function:
     Error: window.useFakeHTMLCanvasGetContext is not a function
      at createSource (test/unit/source/canvas_source.test.js:11:12)
      at Test.t.test (test/unit/source/canvas_source.test.js:64:24)
      at Test.test (test/unit/source/canvas_source.test.js:63:7)

Failed job: https://circleci.com/gh/mapbox/mapbox-gl-js/7292.

#4470 pins to 6.10.0 temporarily so that we can continue working while this is investigated.

@jfirebaugh
Copy link
Contributor Author

Release notes: https://nodejs.org/en/blog/release/v6.10.1/

@jfirebaugh
Copy link
Contributor Author

jfirebaugh commented Mar 23, 2017

This was a latent bug exposed by node fixing nodejs/node#6287, which in turn fixes jsdom/jsdom#1622, which we are implicitly relying on due to the order of actions in window.js:

  1. Delete own properties in previousWindow (=== module.exports)
  2. Extend module.exports with contents of fresh jsdom window
  3. Extend fresh jsdom window with our custom properties, e.g. useFakeHTMLCanvasGetContext

(2) and (3) should occur in the opposite order. It happened to work in prior version of node because (1) didn't actually delete our custom properties due to the above linked issues.

PR incoming.

@jfirebaugh
Copy link
Contributor Author

...turns out fixing that fixes one issue, but there are others. Stay tuned.

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

No branches or pull requests

1 participant