Skip to content

Commit fa292f2

Browse files
committed
test: fix typings build issues
1 parent 0600c91 commit fa292f2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/passport.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import test from 'ava'
77
import type passport from 'passport'
88
import * as client from '../src/index.js'
99
import { Strategy } from '../src/passport.js'
10-
import type { AuthenticateOptions } from '../src/passport.js'
10+
import type { AuthenticateOptions, VerifyFunction } from '../src/passport.js'
1111

1212
function close(server: http.Server): Promise<void> {
1313
return new Promise((resolve, reject) => {
@@ -863,7 +863,7 @@ test('authenticate routes to authorizationCodeGrant for callback GET with code',
863863
const harness = createStrategyHarness(port)
864864

865865
// First, do the auth request to populate session
866-
const redirectTo = await doAuthorizationRequest(harness)
866+
await doAuthorizationRequest(harness)
867867

868868
const req = {
869869
method: 'GET',
@@ -1130,7 +1130,7 @@ test('callback handles POST form_post response', async (t) => {
11301130
t.teardown(() => close(server))
11311131

11321132
const harness = createStrategyHarness(port)
1133-
const redirectTo = await doAuthorizationRequest(harness)
1133+
await doAuthorizationRequest(harness)
11341134

11351135
// Simulate a form_post: the authorization response params come in the POST body
11361136
const formBody = 'code=post_code'
@@ -1211,9 +1211,10 @@ test('authorizationRequest uses JAR when useJAR is configured', async (t) => {
12111211
{
12121212
callbackURL: `http://127.0.0.1:${port}/cb`,
12131213
config,
1214-
useJAR: keyPair.privateKey,
1214+
useJAR: keyPair.privateKey as CryptoKey,
12151215
},
1216-
(_tokens, verified) => verified(null, { sub: 'user' } as Express.User),
1216+
((_tokens: any, verified: any) =>
1217+
verified(null, { sub: 'user' } as Express.User)) as VerifyFunction,
12171218
) as StrategyHarness
12181219

12191220
const session: Record<string, unknown> = {}
@@ -1258,15 +1259,16 @@ test('authorizationRequest uses JAR with modifyAssertion function', async (t) =>
12581259
callbackURL: `http://127.0.0.1:${port}/cb`,
12591260
config,
12601261
useJAR: [
1261-
keyPair.privateKey,
1262+
keyPair.privateKey as CryptoKey,
12621263
(header, _payload) => {
12631264
modifyCalled = true
12641265
// just verify we can modify the header
12651266
header.kid = 'custom-kid'
12661267
},
12671268
],
12681269
},
1269-
(_tokens, verified) => verified(null, { sub: 'user' } as Express.User),
1270+
((_tokens: any, verified: any) =>
1271+
verified(null, { sub: 'user' } as Express.User)) as VerifyFunction,
12701272
) as StrategyHarness
12711273

12721274
const session: Record<string, unknown> = {}

0 commit comments

Comments
 (0)