vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

19 lines
634 B

var assert = require('assert');
var uuid = require('../lib/module/uuid');
describe('UUID', function () {
describe('v1', function () {
it('generates valid, parseable uuid1', function () {
assert(/^[0-9A-F]{8}-[0-9A-F]{4}-[1][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(uuid.v1()));
assert.equal(uuid.parse(uuid.v1()).length, 16)
});
});
describe('v4', function () {
it('generates valid, parseable uuid4', function () {
assert(/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(uuid.v4()));
assert.equal(uuid.parse(uuid.v4()).length, 16)
});
});
});