smartunique/test/test.ts

32 lines
810 B
TypeScript
Raw Normal View History

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