From caf8e1321edab29f7938684b05b796018188e114 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 14 Mar 2021 15:17:38 +0100 Subject: [PATCH 1/2] feat: update to @sinonjs/fake-timers v7 --- packages/jest-fake-timers/package.json | 2 +- packages/jest-fake-timers/src/modernFakeTimers.ts | 1 - packages/jest-fake-timers/tsconfig.json | 6 +++++- yarn.lock | 10 +++++----- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/jest-fake-timers/package.json b/packages/jest-fake-timers/package.json index f82084f65cb5..f3b8f9081c1a 100644 --- a/packages/jest-fake-timers/package.json +++ b/packages/jest-fake-timers/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@jest/types": "^27.0.0-next.3", - "@sinonjs/fake-timers": "^6.0.1", + "@sinonjs/fake-timers": "^7.0.2", "@types/node": "*", "jest-message-util": "^27.0.0-next.3", "jest-mock": "^27.0.0-next.3", diff --git a/packages/jest-fake-timers/src/modernFakeTimers.ts b/packages/jest-fake-timers/src/modernFakeTimers.ts index aba11f4387c6..80cd292a69be 100644 --- a/packages/jest-fake-timers/src/modernFakeTimers.ts +++ b/packages/jest-fake-timers/src/modernFakeTimers.ts @@ -102,7 +102,6 @@ export default class FakeTimers { this._clock = this._fakeTimers.install({ loopLimit: this._maxLoops, now: Date.now(), - target: this._global, toFake, }); diff --git a/packages/jest-fake-timers/tsconfig.json b/packages/jest-fake-timers/tsconfig.json index 9db8e6cc0ed9..bab863a95702 100644 --- a/packages/jest-fake-timers/tsconfig.json +++ b/packages/jest-fake-timers/tsconfig.json @@ -2,7 +2,11 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "build" + "outDir": "build", + // TODO: remove when shipped types are better + "paths": { + "@sinonjs/fake-timers": ["../../node_modules/@types/sinonjs__fake-timers"] + } }, "references": [ {"path": "../jest-message-util"}, diff --git a/yarn.lock b/yarn.lock index 83638517c367..4a2e2adb2e18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2500,7 +2500,7 @@ __metadata: resolution: "@jest/fake-timers@workspace:packages/jest-fake-timers" dependencies: "@jest/types": ^27.0.0-next.3 - "@sinonjs/fake-timers": ^6.0.1 + "@sinonjs/fake-timers": ^7.0.2 "@types/node": "*" "@types/sinonjs__fake-timers": ^6.0.1 jest-message-util: ^27.0.0-next.3 @@ -4127,12 +4127,12 @@ __metadata: languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^6.0.1": - version: 6.0.1 - resolution: "@sinonjs/fake-timers@npm:6.0.1" +"@sinonjs/fake-timers@npm:^7.0.2": + version: 7.0.2 + resolution: "@sinonjs/fake-timers@npm:7.0.2" dependencies: "@sinonjs/commons": ^1.7.0 - checksum: 64458b908773638dda08b555a00e6fbbbc679735348291dc1b7f437ada2f60242537fdc48e4ee82d2573d86984ec87e755b66a96c0ed9ebf0f46b4c6687ccde2 + checksum: b976616900e9ce005f1790b3227697aba909d546b0aed42c75e38f82780ed81d70031ffd9406363ccde3da7f169f2e8a205ef712113d727f896b6cf91aff5e14 languageName: node linkType: hard From 1fe16c291b59490dbafcdb411fa1a293aa4bd7f6 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 14 Mar 2021 15:19:42 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c1e45f2734..9ee2c7eeb31a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - `[jest-core]` Run failed tests interactively the same way we do with snapshots ([#10858](https://github.com/facebook/jest/pull/10858)) - `[jest-core]` more `TestSequencer` methods can be async ([#10980](https://github.com/facebook/jest/pull/10980)) - `[jest-environment-node]` Add AbortController to globals ([#11182](https://github.com/facebook/jest/pull/11182)) +- `[@jest/fake-timers]` Update to `@sinonjs/fake-timers` to v7 ([#11198](https://github.com/facebook/jest/pull/11198)) - `[jest-haste-map]` Handle injected scm clocks ([#10966](https://github.com/facebook/jest/pull/10966)) - `[jest-repl, jest-runner]` [**BREAKING**] Run transforms over environment ([#8751](https://github.com/facebook/jest/pull/8751)) - `[jest-runner]` [**BREAKING**] set exit code to 1 if test logs after teardown ([#10728](https://github.com/facebook/jest/pull/10728))