Skip to content
Myr

Fix tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Sitnik · committed by Andrey Sitnik · parent 464d36b · Browse files · 1 file+9 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−5 removed

  • tests:+9 added−5 removed

1 file+9 added−5 removed

modified:test/index.test.js+9 added-5 removed
27 unmodified lines
28 Object.defineProperty(global, 'crypto', { value: undefined })29 })30 }3132 test('is ready for 0 size', () => {33 equal(nanoid(0), '')34 })3536 test(`generates URL-friendly IDs`, () => {37 for (let i = 0; i < 100; i++) {38 let id = nanoid()39 equal(id.length, 21)
142 unmodified lines
182 ok(byte >= 0)183 }184 })185182 test(`${type} / customAlphabet / does not fall in infinite loop`, () => {183 equal(nanoid(0), '')184 equal(customAlphabet('abc', 0)(0), '')185 })186186 if (type === 'node') {187 test(`${type} / proxy number / prevent collision`, () => {188 let makeProxyNumberToReproducePreviousID = () => {189 let step = 0
23 unmodified lines
213 let id1 = nanoid()214 let id2 = nanoid(makeProxyNumberToReproducePreviousID())215 notEqual(id1, id2)216 })217218 test(`${type} / customAlphabet / does not fall in infinite loop`, () => {219 equal(customAlphabet('abc')(0), '')220 equal(customAlphabet('abc', 0)(0), '')221 })222 }223 })224}