14 lines
398 B
TypeScript
Raw Normal View History

import { generate_token_id, parse_token_id } from '../../lib/token_id';
describe ('token_id', () => {
it ('should always generate valid tokens', () => {
for (let i = 0; i < 1000; i++) {
const date = new Date;
const token_id = generate_token_id (new Date);
const parsed = parse_token_id (token_id);
expect (parsed.valid_until)
.toEqual (date);
}
});
});