mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
0c7b19b192
* chore: migrate core to vitest * chore: migrate url module * chore: migrate tarball package * chore: migrate loader package * chore: migrate hook package * chore: migrate signature package * chore: migrate utils package
18 lines
596 B
TypeScript
18 lines
596 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
|
|
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'");
|
|
});
|
|
});
|
|
});
|