smartunique/test/test.ts

32 lines
810 B
TypeScript
Raw Normal View History

2023-08-15 11:32:46 +02:00
import { expect, tap } from '@push.rocks/tapbundle';
import * as smartunique from '../ts/index.js';
2017-07-14 17:18:27 +02:00
2017-07-14 18:53:10 +02:00
tap.test('should create shortid', async () => {
2020-03-05 20:39:44 +00:00
const result = smartunique.shortId();
2018-10-06 15:38:55 +02:00
console.log(result);
2023-08-15 11:32:46 +02:00
const result2 = smartunique.shortId(8);
console.log(result2);
2018-10-06 15:38:55 +02:00
});
2017-07-14 18:53:10 +02:00
tap.test('should create uuidv4', async () => {
2020-03-05 20:39:44 +00:00
const result = smartunique.uuid4();
2018-10-06 15:38:55 +02:00
console.log(result);
});
2017-07-14 18:53:10 +02:00
tap.test('should create uuidv5', async () => {
2020-03-05 20:39:44 +00:00
const result = smartunique.uuid5('sometext');
2018-10-06 15:38:55 +02:00
console.log(result);
});
2017-07-17 17:01:10 +02:00
tap.test('should create uuidv5 within namespace', async () => {
2020-03-05 20:39:44 +00:00
const result = smartunique.uuid5('sometext', smartunique.uuid4());
console.log(result);
});
tap.test('should create a uni string', async () => {
const result = smartunique.uni();
2018-10-06 15:38:55 +02:00
console.log(result);
});
2017-07-14 17:18:27 +02:00
2018-10-06 15:38:55 +02:00
tap.start();