Example #1
0
File: index.js Project: quxbaz/qux
 it("Generates unique ids.", () => {
   const ids = new Set()
   for (let i=0; i < 1000; i++) {
     ids.add(uniqueId())
   }
   expect(ids.size).toEqual(1000)
 })
Example #2
0
File: index.js Project: quxbaz/qux
 it("ids are string types.", () => {
   expect(typeof uniqueId()).toBe('string')
 })
Example #3
0
File: index.js Project: quxbaz/qux
 it("ids begin at 0.", () => {
   expect(uniqueId()).toBe('0')
 })