Skip to content

Commit

Permalink
test: replace keyset in failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Fournier committed May 6, 2022
1 parent f3d9730 commit d1dbb0f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions tests/ts-definitions.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import expressjwt6 from "express-jwt";
import { expressjwt as expressjwt7, GetVerificationKey } from "express-jwt-v7";
const { jwksEndpoint } = require('../tests/mocks/jwks');
const { publicKey } = require('../tests/mocks/keys');
const { x5cSingle } = require('../tests/keys.js');
const jwksRsa: typeof jwksRsaType = require('../src');

describe('typescript definition', () => {
Expand All @@ -27,20 +28,9 @@ describe('typescript definition', () => {
});

it('getKeysInterceptor', async () => {
const keySetResponse = {
keys: [
{
alg: 'RS256',
kty: 'RSA',
use: 'sig',
kid: 'NkFCNEE1NDFDNTQ5RTQ5OTE1QzRBMjYyMzY0NEJCQTJBMjJBQkZCMA'
}
]
};

const client = new jwksRsa.JwksClient({
jwksUri: `${jwksHost}/.well-known/jwks.json`,
getKeysInterceptor: () => Promise.resolve(keySetResponse.keys)
getKeysInterceptor: () => Promise.resolve(x5cSingle.keys)
});

const key = await client.getSigningKey('NkFCNEE1NDFDNTQ5RTQ5OTE1QzRBMjYyMzY0NEJCQTJBMjJBQkZCMA');
Expand Down

0 comments on commit d1dbb0f

Please sign in to comment.