cocalc/src / smc-project / node_modules / forever-monitor / node_modules / utile / test / random-string-test.js
50655 views/*1* common-test.js : testing common.js for expected functionality2*3* (C) 2011, Nodejitsu Inc.4*5*/67var assert = require('assert'),8vows = require('vows'),9utile = require('../lib');1011vows.describe('utile/randomString').addBatch({12"When using utile": {13"the randomString() function": {14topic: function () {15return utile.randomString();16},17"should return 16 characters that are actually random by default": function (random) {18assert.isString(random);19assert.lengthOf(random, 16);20assert.notEqual(random, utile.randomString());21},22"when you can asked for different length strings": {23topic: function () {24return [utile.randomString(4), utile.randomString(128)];25},26"where they actually are of length 4, 128": function (strings) {27assert.isArray(strings);28assert.lengthOf(strings,2);29assert.isString(strings[0]);30assert.isString(strings[1]);31assert.lengthOf(strings[0], 4);32assert.lengthOf(strings[1], 128);33assert.notEqual(strings[0], strings[1].substr(0,4));34}35}36}37}38}).export(module);394041