From 6bfa75f2efc45699e23d3b0e0259edcd38f9d8ba Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sat, 6 Dec 2025 16:52:02 -0500 Subject: [PATCH 1/3] test: add failing test cases for `onAny` and `onError` These were not added as part of #924, and are now failing. --- test/typescript-validate.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts index 752ec86d..1466b93b 100644 --- a/test/typescript-validate.ts +++ b/test/typescript-validate.ts @@ -173,6 +173,12 @@ export default async function () { console.log(event.foo); }); + webhooks.onAny((event) => { + // Make sure that `TTransformed` is properly passed to `onAny` + // foo is set by options.transform + console.log(event.foo); + }); + // @ts-expect-error TS2345: // Argument of type '"does_not_exist"' is not assignable to parameter of type ... webhooks.on("does_not_exist", (what) => { @@ -182,6 +188,8 @@ export default async function () { webhooks.onError((error) => { console.log(error.event.name); + // Make sure that `TTransformed` is properly passed to `onError` + console.log(error.event.foo); const [firstError] = Array.from(error.errors); console.log(firstError.status); console.log(firstError?.request.headers); From 5e4d861a3a8123298b5ac8dafbdcab036369be40 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sat, 6 Dec 2025 16:52:20 -0500 Subject: [PATCH 2/3] test: fix potentially undefined variable --- test/typescript-validate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/typescript-validate.ts b/test/typescript-validate.ts index 1466b93b..798597f5 100644 --- a/test/typescript-validate.ts +++ b/test/typescript-validate.ts @@ -192,7 +192,7 @@ export default async function () { console.log(error.event.foo); const [firstError] = Array.from(error.errors); console.log(firstError.status); - console.log(firstError?.request.headers); + console.log(firstError?.request?.headers); console.log(firstError.request); }); From 6522017a7f65878e3424fd4c24802f95b00df059 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Sat, 6 Dec 2025 16:58:40 -0500 Subject: [PATCH 3/3] build(tsconfig): remove ts-node config --- tsconfig.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index df9c1180..0b6c5b58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,6 @@ { "extends": "./node_modules/@octokit/tsconfig/tsconfig.json", "include": ["src/**/*"], - "ts-node": { - "compilerOptions": { - "allowImportingTsExtensions": true, - "verbatimModuleSyntax": false - } - }, "compilerOptions": { "allowImportingTsExtensions": true, "erasableSyntaxOnly": true,