Skip to content

Commit e469383

Browse files
fix
1 parent e548fce commit e469383

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

packages/auth0-api-js/src/api-client.spec.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,18 @@ test('getAccessTokenForConnection - should throw when no clientId configured', a
214214
});
215215

216216
test('getAccessTokenForConnection - should throw when no clientSecret configured', async () => {
217-
const apiClient = new ApiClient({
218-
domain,
219-
audience: '<audience>',
220-
clientId: 'my-client-id',
221-
});
222-
223-
await expect(
224-
apiClient.getAccessTokenForConnection({
217+
await expect(async () => {
218+
const apiClient = new ApiClient({
219+
domain,
220+
audience: '<audience>',
221+
clientId: 'my-client-id',
222+
});
223+
224+
await apiClient.getAccessTokenForConnection({
225225
connection: 'my-connection',
226226
accessToken: 'my-access-token',
227-
})
228-
).rejects.toThrow(MissingClientAuthError);
227+
});
228+
}).rejects.toThrow(MissingClientAuthError);
229229
});
230230

231231
test('getAccessTokenForConnection - should return a token set when the exchange is successful', async () => {
@@ -297,18 +297,18 @@ test('getTokenByExchangeProfile - should throw when no clientId configured', asy
297297
});
298298

299299
test('getTokenByExchangeProfile - should throw when no clientSecret configured', async () => {
300-
const apiClient = new ApiClient({
301-
domain,
302-
audience: '<audience>',
303-
clientId: 'my-client-id',
304-
});
305-
306-
await expect(
307-
apiClient.getTokenByExchangeProfile('my-subject-token', {
300+
await expect(async () => {
301+
const apiClient = new ApiClient({
302+
domain,
303+
audience: '<audience>',
304+
clientId: 'my-client-id',
305+
});
306+
307+
await apiClient.getTokenByExchangeProfile('my-subject-token', {
308308
subjectTokenType: 'urn:my-company:mcp-token',
309309
audience: 'https://api.backend.com',
310-
})
311-
).rejects.toThrow(MissingClientAuthError);
310+
});
311+
}).rejects.toThrow(MissingClientAuthError);
312312
});
313313

314314
test('getTokenByExchangeProfile - should return tokens when exchange succeeds', async () => {

0 commit comments

Comments
 (0)