UNPKG
random-uuid-v4
Version:
latest (0.0.9)
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
A lightweight version 4 UUID generator.
github.com/leahciMic/uuid-v4
leahciMic/uuid-v4
random-uuid-v4
/
test.js
9 lines
(7 loc)
•
246 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
var
uuid =
require
(
'./uuidv4.js'
)
var
VALID_REGEX
=
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
it
(
'should create valid regexes'
,
() =>
{
for
(
var
i =
0
; i <
100
; i++) {
expect
(
uuid
()).
toMatch
(
VALID_REGEX
); } });