-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(*): Remove CSS false positives - Use newer JSDom version #12719
chore(*): Remove CSS false positives - Use newer JSDom version #12719
Conversation
Slightly off-topic. Is the I haven't updated Plenty of minor and patch versions too. If tests pass with a
|
Not entirely - dependency changes in packages and e2e/integration tests are currently problematic as |
Yes, failing e2e/integration tests is symptom of With verdaccio support (#11525) we will install same dependencies that are specified in your branch, so those tests will actually be reliable and updating package deps will be much easier both for us (to review) and for contributors (to reliably test their changes before opening PRs). PS. Over the last few days I think "dependencies" is my most used word ;) |
mmh technically we still support node 6 so i'm afraid that our tests might fail in the future |
Hmm if this change should work in node 8+ then our test suite is wonky because unit tests for node 6 are passing right now |
That's the weird thing 😂 maybe babel trickery?
Op vr 22 mrt. 2019 17:22 schreef Michal Piechowiak <[email protected]
…:
Hmm if this change should work in node 8+ then our test suite is wonky
because unit tests for node 6 are passing right now
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12719 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEanjQDhqLzAl3edYLMccj8VKnv3TyFks5vZQNVgaJpZM4cBKOc>
.
|
I just made temporary PR with test that would fail in node 6 - and it does fail ( #12763 ), so I'm fine with dev-only change that technically require node 8+, but actually works :P But yeah, first need verdaccio stuff to for integration/e2e tests to be reliable |
@wardpeet It was passing node 6 unit tests originally iirc, I know there is some reworking of the CI going on so maybe that's why they're failing now? Node 6 will be EOL in May, so I wouldn't be too concerned about future support for much longer? Once Jest drops support for 6 and updates JSDom from 11 to 12+ the corrected test for gatsby-image will fail, requiring the same changes because prior to JSDom 12, there was CSS failing to be picked up.
@pieh Jest won't upgrade JSDom because they drop node 6 support with newer versions, that doesn't necessarily mean that tests will break on node 6, it could mean that certain codepaths may break. I recall the unit tests were passing for node 6 when I submitted this PR but they no longer are now?(Oh nvm it was canceled) This PR shouldn't affect users on node 6 too much afaik, it's only related to JSDom for Jest tests. If it was causing problems, removing the jest config line should use the usual package that was being replaced and they should be able to run tests as before. Either or, Node 6 goes EOL in a little over a month and Jest will update to JSDom 12+ at some point then. Happy to have this PR rejected or left open rather than merged if you like. Apart from the updated If you'd rather not merge, I'll update my linked PR to remove it's updated tests(that are valid when testing |
i'm not against it but technically we are still supporting node 6 as dropping it would be a breaking change. If you merge lastest master in this PR you'll see that CI will work again. |
Required to use JSDom v12+. Drops Node <8 support. Fixes false positives that earlier versions of CSSStyle <1.2 caused.
This test has been giving false-positive for a while. The JSDom update from prior commit fixes that.
7229833
to
4eda063
Compare
I'm not requesting to drop node 6 support. This doesn't change anything on Gatsby's end for actual users afaik, it's just related to CI / Jest for generating proper snapshots and the related test to actually get the correct CSS that an actual Gatsby site would generate anyhow. AFAIK, nothing else is requiring JSDom <12? Nor does this PR appear to cause any breakage in the node 6 test.
Done. If this PR is merged, the committed workaround should be removed once Jest updates to JSDom 12+ later in the year. |
I've done a comparison with jsdom/jsdom@13.2.0...14.0.0 and I agree with @polarathene lets just go for it and if node 6 starts failing we can lock the version. |
Description
Certain CSS styles have been failing to appear in Jest tests due to an outdated JSDom(and some it's dependencies, one being updated with bugfix in Feb 2019). This was causing false positives for
gatsby-image
tests for a while.Nothing major, just some CSS props weren't appearing in tests when they technically should have been.
Details
My PR is failing in the CI but was passing tests locally.
I had been running tests on the
gatsby-image
package on it's own, which usesreact-testing-library: ^5.0.0
, and it failed against the snapshot test. Updated snapshots failed when my PR ran on CircleCI. The main repo root yarn.lock file hasreact-testing-library: ^5.2.1
locked down(retrieves 5.2.1 instead of 5.9.0, although is a v6 release now).Correcting this didn't help for passing the test suite.
cssstyle: 1.2.0
fixes the problems with certain styles being ignored(eg.transitionDelay
, and certain color values forbackgroundColor
, "red" works, but not "lightgray"). That however needsjsdom: ^12.0.0
, but Jest refuses to update as support for Node <8 is dropped..I've added a workaround until Jest supports a newer major version of JSDom. Using
jest-environment-jsdom-fourteen
is the advised approach for the meantime, it'll only impact users running Jest test suite on Node 6, that should be fine for Gatsby? (Node 6 CI test seems to pass)Only
gatsby-image
tests needed updates. Node 6 will be EoL in May, no idea when Jest will bump JSDom from then, but we could wait a few months if you rather avoid the workaround?Related Issues
#12468 (Spotted it while working on this)