-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: upgrade to JSDOM 16 #9606
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f2964c9
Update `jsdom` version 16 and fix breaking changes
lh0x00 b2df96a
Add e2e test `jest-environment-jsdom` to check leaking memory
lh0x00 27cfe49
Update change log to describe about #9606
lh0x00 b6e69f6
Fix issue about ArrayBuffer when upgrading `jsdom` and add a note
lh0x00 2f7b6d1
Remove console log in jest environment jsdom test file
lh0x00 7ff4bfc
Add getVmContext and clean up vm context in teardown
lh0x00 8b317f0
Update 'jsdom' version 16.2.1
00b5e22
Merge pull request #1 from irega/feature/UpgradeJsdom16
lh0x00 6629edc
removed vm context
783a81d
removed unused import DOMWindow
e6ed90b
Merge pull request #2 from irega/feature/UpgradeJsdom16
lh0x00 d5b64eb
Merge branch 'master' into feature/UpgradeJsdom16
SimenB a38dece
16.2.2
SimenB b6570e4
update snaps
SimenB 299c10a
remove unused condition
SimenB 99db95c
Merge branch 'master' into feature/UpgradeJsdom16
SimenB 6a1756d
update changelog
SimenB 90bbcf3
reduce diff
SimenB 47f8326
grammar
SimenB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import {tmpdir} from 'os'; | ||
import {cleanup, writeFiles} from '../Utils'; | ||
import runJest from '../runJest'; | ||
|
||
const DIR = path.resolve(tmpdir(), 'jest_environment_jsdom_test'); | ||
|
||
beforeEach(() => cleanup(DIR)); | ||
afterAll(() => cleanup(DIR)); | ||
|
||
test('check is not leaking memory', () => { | ||
writeFiles(DIR, { | ||
'__tests__/a.test.js': `test('a', () => console.log('a'));`, | ||
'__tests__/b.test.js': `test('b', () => console.log('b'));`, | ||
'package.json': JSON.stringify({jest: {testEnvironment: 'jsdom'}}), | ||
}); | ||
|
||
const {stderr} = runJest(DIR, ['--detect-leaks', '--runInBand']); | ||
expect(stderr).toMatch(/PASS\s__tests__\/a.test.js/); | ||
expect(stderr).toMatch(/PASS\s__tests__\/b.test.js/); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This change is wrong, since it causes the newly‑created global to have the
ArrayBuffer
constructor from the outer realm, whereas jsdom/jsdom@3a4fd62 made it so that the inner realm has its ownArrayBuffer
constructor and prototype chain.Refs: #10786, #10854
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.
@ExE-Boss great! Wanna send a PR?
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.
@SimenB #10885