Skip to content

Commit

Permalink
Add JWT test
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Pow committed Aug 6, 2024
1 parent cdbd48c commit af7eea5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/utils/Jwt.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { encodeJwt } from '@/utils/Jwt';

describe('JWT', () => {
it('should encode JWTs with a body and secret', async () => {
const jwtReceived = await encodeJwt(JSON.stringify({ text: 'blah' }), { secret: 'asdf' });
const jwtExpected = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0IjoiYmxhaCJ9.0nRqiVV4_-MEG6S7jcQgfU7UEJosJ8gO_cgwmWYV56Q';

expect(jwtReceived).toBe(jwtExpected);
});
});

0 comments on commit af7eea5

Please # to comment.