Skip to content
Myr

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 file

Take it

Fix formattingAndrey Sitnikbefore adoption1a97659

lines 1–20why, one step back
1import { equal, match } from 'node:assert'
2import { describe, test } from 'node:test'34import { nanoid, urlAlphabet } from '../index.js'56describe('pool pollution', () => {7 test(`generates large IDs`, () => {8 try {9 nanoid(1000)10 } catch {}11 try {12 nanoid(500)13 } catch {}14 let id = nanoid(100)15 equal(id.length, 100)16 for (let char of id) {17 match(urlAlphabet, new RegExp(char, 'g'))18 }19 })20})