wip: migrate to bun

This commit is contained in:
jdalton
2023-09-16 14:47:50 -07:00
parent 2da024c3b4
commit 97d4a2fe19
1052 changed files with 30244 additions and 26856 deletions

20
test/uniqueId.spec.ts Normal file
View File

@@ -0,0 +1,20 @@
import assert from 'node:assert';
import lodashStable from 'lodash';
import uniqueId from '../src/uniqueId';
describe('uniqueId', () => {
it('should generate unique ids', () => {
const actual = lodashStable.times(1000, () => uniqueId());
assert.strictEqual(lodashStable.uniq(actual).length, actual.length);
});
it('should return a string value when not providing a `prefix`', () => {
assert.strictEqual(typeof uniqueId(), 'string');
});
it('should coerce the prefix argument to a string', () => {
const actual = [uniqueId(3), uniqueId(2), uniqueId(1)];
assert.ok(/3\d+,2\d+,1\d+/.test(actual));
});
});