mirror of https://github.com/seald/nedb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
646 B
20 lines
646 B
/* eslint-env mocha */
|
|
const chai = require('chai')
|
|
const customUtils = require('../lib/customUtils')
|
|
|
|
chai.should()
|
|
describe('customUtils', function () {
|
|
describe('uid', function () {
|
|
it('Generates a string of the expected length', function () {
|
|
customUtils.uid(3).length.should.equal(3)
|
|
customUtils.uid(16).length.should.equal(16)
|
|
customUtils.uid(42).length.should.equal(42)
|
|
customUtils.uid(1000).length.should.equal(1000)
|
|
})
|
|
|
|
// Very small probability of conflict
|
|
it('Generated uids should not be the same', function () {
|
|
customUtils.uid(56).should.not.equal(customUtils.uid(56))
|
|
})
|
|
})
|
|
})
|
|
|