pool.test.js
This file
Path
test/pool.test.js
20 lines · 438 bytes · JavaScript
Last changed by
Fix formattingAndrey Sitnikbefore adoption1a97659
History of this fileTake it
123456789101112131415161718192021import { equal, match } from 'node:assert'import { describe, test } from 'node:test'
import { nanoid, urlAlphabet } from '../index.js'
describe('pool pollution', () => { test(`generates large IDs`, () => { try { nanoid(1000) } catch {} try { nanoid(500) } catch {} let id = nanoid(100) equal(id.length, 100) for (let char of id) { match(urlAlphabet, new RegExp(char, 'g')) } })})