0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-13 22:48:31 -05:00
verdaccio/packages/utils/test/auth-utils.spec.ts

17 lines
546 B
TypeScript
Raw Normal View History

import { createSessionToken, getAuthenticatedMessage } from '../src';
2020-03-08 09:19:12 +01:00
describe('Auth Utilities', () => {
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 09:19:12 +01:00
});