1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01: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

17 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'");
});
});
});