0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/packages/utils/test/auth-utils.spec.ts
Juan Picado 62c24b6321
feat: add passwordValidationRegex property (#3384)
* feat: add passwordValidationRegex property

* chore: improve validation

* Update validation-utilts.spec.ts

* Update validation-utilts.spec.ts

* chore: remove code
2022-09-17 19:29:40 +02:00

16 lines
546 B
TypeScript

import { createSessionToken, getAuthenticatedMessage } from '../src';
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'");
});
});
});