Skip to content

Commit

Permalink
re-add declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Nov 30, 2023
1 parent 59fe42c commit 1bbd815
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/testing/matchers/toBeGarbageCollected.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import type { MatcherFunction } from "expect";

// this is necessary because this file is picked up by `tsc` (it's not a test),
// but our main `tsconfig.json` doesn't include `"ES2021.WeakRef"` on purpose
declare class WeakRef<T extends WeakKey> {
constructor(target: T);
deref(): T | undefined;
}

export const toBeGarbageCollected: MatcherFunction<[weakRef: WeakRef<any>]> =
async function (actual) {
const hint = this.utils.matcherHint("toBeGarbageCollected");
Expand Down

0 comments on commit 1bbd815

Please sign in to comment.