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

chore: Upgrade jsdom to v21 which still supports Node 14 #584

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -97,7 +97,7 @@
"expect": "^29.6.2",
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-watch-select-projects": "^2.0.0",
"jsdom": "^16.2.1",
"jsdom": "^21.1.2",
"kcd-scripts": "^14.0.0",
"pretty-format": "^25.1.0",
"rollup": "^3.28.1",
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/to-be-invalid.js
@@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
Comment on lines +1 to +3
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves this issue

I copy pasted from this PR

https://github.com/testing-library/jest-dom/pull/568/files?w=1#diff-aac3f7b77b88910a3cab3e23a102333b446c87359e633f41c0441c7738791d5b

  ● Test suite failed to run

    ReferenceError: TextEncoder is not defined

      1 |
      2 |
    > 3 | import {JSDOM} from 'jsdom'
        | ^
      4 | import {render} from './helpers/test-utils'
      5 |
      6 | /*


import {JSDOM} from 'jsdom'
import {render} from './helpers/test-utils'

Expand Down
5 changes: 5 additions & 0 deletions src/__tests__/to-have-style.js
Expand Up @@ -19,6 +19,7 @@ describe('.toHaveStyle', () => {
float: left;
transition: opacity 0.2s ease-out, top 0.3s cubic-bezier(1.175, 0.885, 0.32, 1.275);
transform: translateX(0px);
aspect-ratio: 1 / 1;
}
`
document.body.appendChild(style)
Expand Down Expand Up @@ -55,6 +56,10 @@ describe('.toHaveStyle', () => {
expect(container.querySelector('.label')).toHaveStyle(`
transform: translateX(0px);
`)

expect(container.querySelector('.label')).toHaveStyle(`
aspect-ratio: 1 / 1;
`)
})

test('handles negative test cases', () => {
Expand Down