Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added test for string return, updated package.json.

  • Loading branch information...
commit 75d27ce2dd3196d8e487876bd4037ed7cb38b3a5 1 parent f66323f
@ericelliott authored
View
7 package.json
@@ -1,6 +1,6 @@
{
"name": "cuid",
- "version": "1.1.5",
+ "version": "1.1.6",
"description": "Collission-resistant ids optimized for horizontal scaling and performance. For node and browsers.",
"author": {
"name": "Eric Elliott",
@@ -18,9 +18,10 @@
"url": "https://github.com/dilvie/cuid.git"
},
"directories": {
- "test": "./test",
+ "dist": "./dist",
+ "lib": "./lib",
"src": "./src",
- "dist": "./dist"
+ "test": "./test"
},
"scripts": {
"postinstall": "grunt install",
View
11 test/applitude-cuid-test.js
@@ -3,14 +3,15 @@
'use strict';
var collision = false;
- test('Collision test', function () {
+ test('cuid()', function () {
stop();
(function () {
var ids = window.ids = {},
+ cuid = applitude.cuid,
i,
id;
for (i = 0; i < 600000; i++) {
- id = applitude.cuid();
+ id = cuid();
if (!ids[id]) {
ids[id] = id;
} else {
@@ -18,8 +19,12 @@
break;
}
}
+
+ ok(typeof cuid() === 'string',
+ '.cuid() should return a string');
+
ok(!collision,
- 'ids should not collide');
+ '.cuid() should generate unique ids on a single machine');
start();
View
8 test/browser-cuid-test.js
@@ -3,7 +3,7 @@
'use strict';
var collision = false;
- test('Collision test', function () {
+ test('cuid()', function () {
stop();
(function () {
var ids = window.ids = {},
@@ -18,8 +18,12 @@
break;
}
}
+
+ ok(typeof cuid() === 'string',
+ '.cuid() should return a string');
+
ok(!collision,
- 'ids should not collide');
+ '.cuid() should generate unique ids on a single machine');
start();
View
4 test/node-cuid-test.js
@@ -16,6 +16,10 @@ exports.testcuid = function (test) {
break;
}
}
+
+ test.ok(typeof cuid() === 'string',
+ '.cuid() should return a string');
+
test.ok(!collision,
'ids should not collide');
Please sign in to comment.
Something went wrong with that request. Please try again.