Skip to content

Commit

Permalink
Added unit test for uuid generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrew1303 committed Dec 22, 2014
1 parent daa9f44 commit 2a46c19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/random.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ describe("random.js", function () {
assert.equal(opts.max, max);
});
});

describe('UUID', function() {
it('should generate a valid UUID', function() {
var UUID = faker.random.uuid();
var RFC4122 = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
assert.ok(RFC4122.test(UUID));
})
})
});

0 comments on commit 2a46c19

Please sign in to comment.