From 9c0eaaceda374acebf84de7234d839b1c6143e07 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Mon, 1 Apr 2024 19:24:34 +0000 Subject: [PATCH] chore: add Brittle's `t.snapshot()` to type definitions Brittle has `t.snapshot()` which checks a value against a snapshot. It's undocumented but we use it. This commit adds it to the type definitions and removes a `@ts-ignore`. See also: [a PR on Brittle to document this function][0]. [0]: https://github.com/holepunchto/brittle/pull/45 --- test-e2e/manager-basic.js | 1 - types/brittle.d.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/test-e2e/manager-basic.js b/test-e2e/manager-basic.js index fc1f82763..8b06b227c 100644 --- a/test-e2e/manager-basic.js +++ b/test-e2e/manager-basic.js @@ -373,7 +373,6 @@ test('Consistent storage folders', async (t) => { await project.$getOwnRole() } - // @ts-ignore snapshot() is missing from typedefs t.snapshot(storageNames.sort()) }) diff --git a/types/brittle.d.ts b/types/brittle.d.ts index 767ff6790..166122d64 100644 --- a/types/brittle.d.ts +++ b/types/brittle.d.ts @@ -53,6 +53,7 @@ declare module 'brittle' { fail(message?: string): void exception: ExceptionAssertion execution(fn: T | Promise, message?: string): Promise + snapshot(actual: unknown, message?: string): void } interface TestOptions {