-
Notifications
You must be signed in to change notification settings - Fork 470
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: Release v8 as stable #979
Conversation
BREAKING CHANGE: Remove deprecated `waitFormDOMChange` BREAKING CHANGE: The `timeout` in `waitFor(callback, { interval, timeout } )` now uses the same clock as `interval`. Previously `timeout` was always using the real clock while `interval` was using the global clock which could've been mocked out. For the old behavior I'd recommend `waitFor(callback, { interval, timeout: Number.PositiveInfinity })` and rely on your test runner to timeout considering real timers.
BREAKING CHANGE: Remove deprecated `waitForElement`
Co-authored-by: Tim Deschryver <[email protected]>
BREAKING CHANGE: node 10 is no longer supported. It reached its end-of-life on 30.04.2021.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5b15f6f:
|
Codecov Report
@@ Coverage Diff @@
## main #979 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 25 -1
Lines 966 914 -52
Branches 298 281 -17
=========================================
- Hits 966 914 -52
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a note that OptionsReceived
is replaced with PrettyFormatOptions
?
I bumped against this problem while I was preparing the upgrade for Angular Testing Library.
It's not a breaking change, no. You can still pass But we should rename it to Edit: |
…tAnimationFrame (#978)
I'm currently testing the impact this will have on https://github.com/kentcdodds/bookshelf as well as another final test before giving this the green light. |
As usual, react-query + jest fake timers is an issue (don't worry about the long time the test is taking, my computer is currently doing some other resource intensive video conversion): I tried my react-query v3 branch and had the same issue. In both cases, if I remove the fake timers then the test passes just fine. If I try to upgrade to jest 27, I get an error because this is a CRA app. I'm guessing this means that the combination of these tools/versions is problematic, so I'll probably just need to lock the versions if I don't want to make some major changes which is ultimately inevitable anyway, so I will not block this release on that. All the other tests for that app work without trouble. Once this is ready to merge then I think we're good. |
I think ultimately I'm hoping that we can offer a workaround in a feature release where people can implement their own clock and therefore go back to the old The main goal of this major is to make the behavior more predictable (e.g. no more mixing of clocks, no more usage of Thanks for the hint about react-query though. I'll take that repo and your bookshelf app into consideration for future integration testing. I was focusing too much on libraries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the latest alpha release in ATL and all tests are passing, using Jest 26.
🎉 This PR is included in version 8.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Recommendations:
jest
fake timers make sure you use modern timersjest 27:
BREAKING CHANGE: Remove deprecated
waitFormDOMChange
BREAKING CHANGE: Remove deprecated
waitForElement
BREAKING CHANGE: The
timeout
inwaitFor(callback, { interval, timeout } )
now uses the same clock asinterval
. Previouslytimeout
was always using the real clock whileinterval
was using the global clock which could've been mocked out. For the old behavior I'd recommendwaitFor(callback, { interval, timeout: Number.POSITIVE_INFINITY })
and rely on your test runner to timeout considering real timers.BREAKING CHANGE:
<script />
,<style />
and comment nodes are now ignored by default inprettyDOM
.If you whish to return to the old behavior, use a customfilterNode
function. In this caseprettyDOM(element, { filterNode: () => true })
.BREAKING CHANGE: node 10 is no longer supported. It reached its end-of-life on 30.04.2021.
What:
Prepare new major release
Why:
Ran promising tests in
This revealed test(waitFor): Add current behavior for legacy fake timers and requestAnimationFrame #978 which only affects legacy fake timers in jest 26 i.e. latest jest releases are unaffected
How:
Merge (not squash&merge)
alpha
intomain
Checklist:
docs site
docs(dom): Document breaking changes of v8 testing-library-docs#866