aboutsummaryrefslogtreecommitdiff
path: root/test/random.unit.js
diff options
context:
space:
mode:
authorJames Drew <[email protected]>2014-12-22 21:52:01 +0000
committerJames Drew <[email protected]>2014-12-22 21:52:01 +0000
commit2a46c19f932da6f08a0fc71cb92def44f4f08075 (patch)
tree70a1b98778cdbcc4ea15e157411bfb91ff43064a /test/random.unit.js
parentdaa9f442797525c9547c329665b4e9107b41d375 (diff)
downloadfaker-2a46c19f932da6f08a0fc71cb92def44f4f08075.tar.xz
faker-2a46c19f932da6f08a0fc71cb92def44f4f08075.zip
Added unit test for uuid generator
Diffstat (limited to 'test/random.unit.js')
-rw-r--r--test/random.unit.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/random.unit.js b/test/random.unit.js
index 6071767b..da1274fd 100644
--- a/test/random.unit.js
+++ b/test/random.unit.js
@@ -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));
+ })
+ })
});