-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Use globalThis
if available
#1070
Conversation
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 4df5d4d:
|
40d8f04
to
3354c19
Compare
3354c19
to
4df5d4d
Compare
Codecov Report
@@ Coverage Diff @@
## main #1070 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 181 181
Branches 36 36
=========================================
Hits 181 181
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I've been wondering if this should be covered by a test. This is always the hard part... |
We didn't cover the other branches as well. The specific bug can only be tested with older versions of vitest anyway. |
🎉 This PR is included in version 13.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've added a linting rule in (Because of issues with environments which shadow global variables in test. Resulting in constructors not being identical, thus errors in |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@testing-library/react](https://github.com/testing-library/react-testing-library) | dependencies | minor | [`13.2.0` -> `13.4.0`](https://renovatebot.com/diffs/npm/@testing-library%2freact/13.2.0/13.4.0) | --- ### Release Notes <details> <summary>testing-library/react-testing-library (@​testing-library/react)</summary> ### [`v13.4.0`](https://github.com/testing-library/react-testing-library/releases/tag/v13.4.0) [Compare Source](testing-library/react-testing-library@v13.3.0...v13.4.0) ##### Features - **renderHook:** allow passing of all render options to renderHook ([#​1118](testing-library/react-testing-library#1118)) ([27a9584](testing-library/react-testing-library@27a9584)) ### [`v13.3.0`](https://github.com/testing-library/react-testing-library/releases/tag/v13.3.0) [Compare Source](testing-library/react-testing-library@v13.2.0...v13.3.0) ##### Features - Use `globalThis` if available ([#​1070](testing-library/react-testing-library#1070)) ([c80809a](testing-library/react-testing-library@c80809a)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNSIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi41IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://gitea.bruyant.xyz/alexandre/PaletteSwitcher/pulls/46 Co-authored-by: Renovate <[email protected]> Co-committed-by: Renovate <[email protected]>
What:
Closes #1061
Why:
Test runners like
vitest
create environments wherewindow
does not reflectself
. This is not an environment that exists outside ofvitest
. This was fixed in latest versions ofvitest
(see vitest-dev/vitest#1256).But it's good to get in anyway to support older versions as well as other test environments that aren't configured properly but run in later versions of Node or browsers.
How:
Use
globalThis
if available.Checklist:
[ ]Documentation added to thedocs site
[ ]TypeScript definitions updated