2022-09-17 12:29:40 -05:00
|
|
|
import { createSessionToken, getAuthenticatedMessage } from '../src';
|
2020-03-08 03:19:12 -05:00
|
|
|
|
|
|
|
describe('Auth Utilities', () => {
|
2020-08-13 16:27:00 -05:00
|
|
|
describe('createSessionToken', () => {
|
|
|
|
test('should generate session token', () => {
|
|
|
|
expect(createSessionToken()).toHaveProperty('expires');
|
|
|
|
expect(createSessionToken().expires).toBeInstanceOf(Date);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('getAuthenticatedMessage', () => {
|
|
|
|
test('should generate user message token', () => {
|
|
|
|
expect(getAuthenticatedMessage('foo')).toEqual("you are authenticated as 'foo'");
|
|
|
|
});
|
|
|
|
});
|
2020-03-08 03:19:12 -05:00
|
|
|
});
|