Skip to content

Commit

Permalink
bump types/node to v12
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 11, 2021
1 parent 549513c commit dfc03e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/babel__template": "^7.0.0",
"@types/dedent": "0.7.0",
"@types/jest": "^26.0.15",
"@types/node": "~10.14.0",
"@types/node": "~12.12.70",
"@types/which": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-core/src/collectHandles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function stackIsFromUser(stack: string) {

const alwaysActive = () => true;

// @ts-expect-error: doesn't exist in v10 typings
// @ts-expect-error: doesn't exist in v12 typings
const hasWeakRef = typeof WeakRef === 'function';

const asyncSleep = promisify(setTimeout);
Expand Down Expand Up @@ -96,13 +96,12 @@ export default function collectHandles(): HandleCollectionResult {
// Timer that supports hasRef (Node v11+)
if ('hasRef' in resource) {
if (hasWeakRef) {
// @ts-expect-error: doesn't exist in v10 typings
// @ts-expect-error: doesn't exist in v12 typings
const ref = new WeakRef(resource);
isActive = () => {
return ref.deref()?.hasRef() ?? false;
};
} else {
// @ts-expect-error: doesn't exist in v10 typings
isActive = resource.hasRef.bind(resource);
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ __metadata:
"@types/babel__template": ^7.0.0
"@types/dedent": 0.7.0
"@types/jest": ^26.0.15
"@types/node": ~10.14.0
"@types/node": ~12.12.70
"@types/which": ^2.0.0
"@typescript-eslint/eslint-plugin": ^4.1.0
"@typescript-eslint/parser": ^4.1.0
Expand Down Expand Up @@ -4728,10 +4728,10 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:*, @types/node@npm:~10.14.0":
version: 10.14.22
resolution: "@types/node@npm:10.14.22"
checksum: 392965766fc7f221169d62e4dafbfc875ba172ce610ac48fec26eaf572386913bd2c5d2e036bb747bb49923f1ade9eed2b2d09a391cbf5fbaaa864a74a4dad60
"@types/node@npm:*, @types/node@npm:~12.12.70":
version: 12.12.70
resolution: "@types/node@npm:12.12.70"
checksum: ef0ea535b8301d7d8f89d848bb7d5028bbd702d8d96b812100cba71829b460fc0d00cbbf296909254c49d0efe5a57dd37d40ba3abaca902dc170034e90f651a2
languageName: node
linkType: hard

Expand Down

0 comments on commit dfc03e7

Please sign in to comment.