File: test.js

package info (click to toggle)
node-unique-string 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 100 kB
  • sloc: makefile: 2; sh: 2
file content (20 lines) | stat: -rw-r--r-- 285 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import test from 'ava';
import m from './';

test(t => {
	t.is(m().length, 32);

	const created = new Set();

	for (let i = 0; i < 100000; i++) {
		const str = m();

		if (created.has(str)) {
			t.fail(`${str} already exists`);
		}

		t.is(str.length, 32);

		created.add(str);
	}
});