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

Upgrade jsdom to 11.4 #4919

Merged
merged 3 commits into from
Nov 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## master

### Fixes

* `[expect]` fix .toThrow for promises
([#4884](https://github.com/facebook/jest/pull/4884))
* `[jest-docblock]` pragmas should preserve urls
Expand Down Expand Up @@ -46,7 +47,6 @@
* `[jest-cli]` Fix `--onlyChanged` path case sensitivity on Windows platform
([#4730](https://github.com/facebook/jest/pull/4730))


### Features

* `[jest-mock]` Add `timestamps` to mock state.
Expand Down Expand Up @@ -104,6 +104,9 @@
([#4497](https://github.com/facebook/jest/pull/4497))
* `[jest-jasmine2]` Add `testLocationInResults` flag to add location information
per spec to test results ([#4782](https://github.com/facebook/jest/pull/4782))
* `[jest-environment-jsdom]` Update JSOM to 11.4, which includes built-in
support for `requestAnimationFrame`
([#4919](https://github.com/facebook/jest/pull/4919))

### Chore & Maintenance

Expand Down Expand Up @@ -134,7 +137,7 @@
([#4578](https://github.com/facebook/jest/pull/4578))
* `[jest-runtime]` Add `.advanceTimersByTime`; keep `.runTimersToTime()` as an
alias.
* `[docs]` Include missing dependency in TestEnvironment sample code
* `[docs]` Include missing dependency in TestEnvironment sample code
* `[docs]` Add clarification for hook execution order

## jest 21.2.1
Expand Down
19 changes: 0 additions & 19 deletions integration_tests/__tests__/request_animation_frame.test.js

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions integration_tests/request_animation_frame/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/jest-environment-jsdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"dependencies": {
"jest-mock": "^21.2.0",
"jest-util": "^21.2.1",
"jsdom": "~11.2.0"
"jsdom": "^11.4.0"
}
}
14 changes: 1 addition & 13 deletions packages/jest-environment-jsdom/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class JSDOMEnvironment {
const jsdomInitialized = process.hrtime();

this.dom = new JSDOM('<!DOCTYPE html>', {
pretendToBeVisual: true,
runScripts: 'dangerously',
url: config.testURL,
});
Expand All @@ -35,19 +36,6 @@ class JSDOMEnvironment {
this.global.Error.stackTraceLimit = 100;
installCommonGlobals(global, config.globals);

if (!global.requestAnimationFrame || !global.cancelAnimationFrame) {
global.requestAnimationFrame = callback => {
const hr = process.hrtime(jsdomInitialized);
const hrInNano = hr[0] * 1e9 + hr[1];
const hrInMicro = hrInNano / 1e6;

return global.setTimeout(callback, 0, hrInMicro);
};
global.cancelAnimationFrame = id => {
return global.clearTimeout(id);
};
}

// Report uncaught errors.
this.errorEventListener = event => {
if (userErrorListenerCount === 0 && event.error) {
Expand Down
60 changes: 35 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ accepts@1.3.3:
mime-types "~2.1.11"
negotiator "0.6.1"

acorn-globals@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf"
acorn-globals@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538"
dependencies:
acorn "^4.0.4"
acorn "^5.0.0"

acorn-jsx@^3.0.0:
version "3.0.1"
Expand All @@ -50,13 +50,13 @@ acorn@^3.0.4:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"

acorn@^4.0.1, acorn@^4.0.3, acorn@^4.0.4:
acorn@^4.0.1, acorn@^4.0.3:
version "4.0.13"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"

acorn@^5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7"
acorn@^5.0.0, acorn@^5.1.1, acorn@^5.1.2:
version "5.2.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"

add-stream@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -1092,6 +1092,10 @@ browser-pack@^6.0.1:
through2 "^2.0.0"
umd "^3.0.0"

browser-process-hrtime@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e"

browser-resolve@^1.11.0, browser-resolve@^1.11.2, browser-resolve@^1.7.0:
version "1.11.2"
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
Expand Down Expand Up @@ -2081,6 +2085,10 @@ domelementtype@~1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"

domexception@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.0.tgz#81fe5df81b3f057052cde3a9fa9bf536a85b9ab0"

domhandler@^2.3.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259"
Expand Down Expand Up @@ -2250,7 +2258,7 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"

escodegen@^1.6.1:
escodegen@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852"
dependencies:
Expand Down Expand Up @@ -3588,30 +3596,32 @@ jschardet@^1.4.2:
version "1.5.1"
resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.1.tgz#c519f629f86b3a5bedba58a88d311309eec097f9"

jsdom@~11.2.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.2.0.tgz#4f6b8736af3357c3af7227a3b54a5bda1c513fd6"
jsdom@^11.4.0:
version "11.4.0"
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.4.0.tgz#a3941a9699cbb0d61f8ab86f6f28f4ad5ea60d04"
dependencies:
abab "^1.0.3"
acorn "^4.0.4"
acorn-globals "^3.1.0"
acorn "^5.1.2"
acorn-globals "^4.0.0"
array-equal "^1.0.0"
browser-process-hrtime "^0.1.2"
content-type-parser "^1.0.1"
cssom ">= 0.3.2 < 0.4.0"
cssstyle ">= 0.2.37 < 0.3.0"
escodegen "^1.6.1"
domexception "^1.0.0"
escodegen "^1.9.0"
html-encoding-sniffer "^1.0.1"
nwmatcher "^1.4.1"
nwmatcher "^1.4.3"
parse5 "^3.0.2"
pn "^1.0.0"
request "^2.79.0"
request "^2.83.0"
request-promise-native "^1.0.3"
sax "^1.2.1"
symbol-tree "^3.2.1"
tough-cookie "^2.3.2"
webidl-conversions "^4.0.0"
tough-cookie "^2.3.3"
webidl-conversions "^4.0.2"
whatwg-encoding "^1.0.1"
whatwg-url "^6.1.0"
whatwg-url "^6.3.0"
xml-name-validator "^2.0.1"

jsesc@^1.3.0:
Expand Down Expand Up @@ -4406,7 +4416,7 @@ number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"

nwmatcher@^1.4.1:
nwmatcher@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c"

Expand Down Expand Up @@ -5170,7 +5180,7 @@ request@2.81.0, request@^2.81.0:
tunnel-agent "^0.6.0"
uuid "^3.0.0"

request@^2.79.0:
request@^2.83.0:
version "2.83.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
dependencies:
Expand Down Expand Up @@ -5864,7 +5874,7 @@ to-fast-properties@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"

tough-cookie@>=2.3.3, tough-cookie@^2.3.2, tough-cookie@~2.3.3:
tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"
dependencies:
Expand Down Expand Up @@ -6135,7 +6145,7 @@ weak@^1.0.1:
bindings "^1.2.1"
nan "^2.0.5"

webidl-conversions@^4.0.0, webidl-conversions@^4.0.1:
webidl-conversions@^4.0.1, webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"

Expand All @@ -6149,7 +6159,7 @@ whatwg-fetch@>=0.10.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"

whatwg-url@^6.1.0:
whatwg-url@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.3.0.tgz#597ee5488371abe7922c843397ddec1ae94c048d"
dependencies:
Expand Down