@tdb/util
Version:
Shared helpers and utilities.
16 lines • 608 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var chai_1 = require("chai");
var libs_1 = require("../../libs");
var _1 = require(".");
describe('id.shortid', function () {
it('creates a new short id', function () {
var result = _1.id.shortid();
chai_1.expect(result.length).to.be.greaterThan(5);
});
it('ids are unique', function () {
var ids = Array.from({ length: 1000 }).map(function () { return _1.id.shortid(); });
chai_1.expect(ids.length).to.eql(libs_1.R.uniq(ids).length);
});
});
//# sourceMappingURL=shortid.test.js.map