mirror of
https://github.com/zhigang1992/react-content-loader.git
synced 2026-04-22 19:48:51 +08:00
* Improvement tests * Add Istanbul: Code Coverage Tool * Fix tests * Uid test * Removed istanbul in the depencies
18 lines
402 B
JavaScript
Executable File
18 lines
402 B
JavaScript
Executable File
import chai, { expect } from 'chai'
|
|
|
|
import uid from '../src/uid'
|
|
|
|
describe('unique id', () => {
|
|
const options = 100
|
|
const ids = new Array(options).fill(' ').map(item => uid())
|
|
const unique = Array.from(new Set(ids))
|
|
|
|
it(`should have ${options} diferents ids`, () => {
|
|
expect(unique).to.have.length(options)
|
|
})
|
|
|
|
it(`return a string`, () => {
|
|
expect(uid()).to.be.a('string')
|
|
})
|
|
})
|