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

  1. var assert = require('assert');
  2. var uuid = require('../lib/module/uuid');
  3. describe('UUID', function () {
  4. describe('v1', function () {
  5. it('generates valid, parseable uuid1', function () {
  6. 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()));
  7. assert.equal(uuid.parse(uuid.v1()).length, 16)
  8. });
  9. });
  10. describe('v4', function () {
  11. it('generates valid, parseable uuid4', function () {
  12. 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()));
  13. assert.equal(uuid.parse(uuid.v4()).length, 16)
  14. });
  15. });
  16. });