smartunique/test/test.ts
2023-08-15 11:32:46 +02:00

32 lines
810 B
TypeScript

import { expect, tap } from '@push.rocks/tapbundle';
import * as smartunique from '../ts/index.js';
tap.test('should create shortid', async () => {
const result = smartunique.shortId();
console.log(result);
const result2 = smartunique.shortId(8);
console.log(result2);
});
tap.test('should create uuidv4', async () => {
const result = smartunique.uuid4();
console.log(result);
});
tap.test('should create uuidv5', async () => {
const result = smartunique.uuid5('sometext');
console.log(result);
});
tap.test('should create uuidv5 within namespace', async () => {
const result = smartunique.uuid5('sometext', smartunique.uuid4());
console.log(result);
});
tap.test('should create a uni string', async () => {
const result = smartunique.uni();
console.log(result);
});
tap.start();