Skip to content

Commit

Permalink
Add unit test to make sure we reject invalid tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Sep 7, 2023
1 parent 6906f7d commit de20eb1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ describe('authRefreshToken', () => {
});

describe('validateAccessToken', () => {
it('should reject invalid token', async () => {
expect.assertions(1);
try {
await fief.validateAccessToken('INVALID_TOKEN');
} catch (err) {
expect(err).toBeInstanceOf(FiefAccessTokenInvalid);
}
});

it('should reject invalid signature', async () => {
expect.assertions(1);
try {
Expand Down

0 comments on commit de20eb1

Please sign in to comment.