Comparing version 1.5.12 to 1.5.13
{ | ||
"name": "casual", | ||
"version": "1.5.12", | ||
"version": "1.5.13", | ||
"description": "Fake data generator", | ||
@@ -5,0 +5,0 @@ "main": "src/casual.js", |
@@ -61,2 +61,3 @@ var helpers = require('./helpers'); | ||
'it_CH', | ||
'it_IT', | ||
'de_DE', | ||
@@ -63,0 +64,0 @@ 'ar_SY', |
@@ -9,3 +9,3 @@ var moment = require('moment'); | ||
unix_time: function() { | ||
return this.integer(0, moment().unix()); | ||
return this.integer(0, 1462369607); | ||
}, | ||
@@ -12,0 +12,0 @@ |
@@ -287,17 +287,20 @@ var casual = require('../'); | ||
var create_data_set = function() { | ||
return [ | ||
casual.description, | ||
casual.text, | ||
casual.random, | ||
casual.integer, | ||
casual.card_number, | ||
casual.phone, | ||
casual.unix_time, | ||
casual.day_of_year, | ||
casual.date, | ||
casual.time | ||
]; | ||
return { | ||
description: casual.description, | ||
text: casual.text, | ||
random: casual.random, | ||
integer: casual.integer, | ||
card_number: casual.card_number, | ||
phone: casual.phone, | ||
unix_time: casual.unix_time, | ||
day_of_year: casual.day_of_year, | ||
date: casual.date, | ||
time: casual.time, | ||
moment_string: casual.moment.toISOString(), | ||
}; | ||
}; | ||
it('Should repeat random sequence on same seed', function() { | ||
it('Should repeat random sequence on same seed', function(done) { | ||
this.timeout(3000); | ||
var seed = 123; | ||
@@ -308,8 +311,12 @@ | ||
casual.seed(seed); | ||
var set2 = create_data_set(); | ||
setTimeout(function () { | ||
casual.seed(seed); | ||
var set2 = create_data_set(); | ||
for (var i in set1) { | ||
set1[i].should.be.equal(set2[i]); | ||
} | ||
for (var i in set1) { | ||
set1[i].should.be.equal(set2[i], i); | ||
} | ||
done(); | ||
}, 2001); // Check for date/time perturbation | ||
}) | ||
@@ -316,0 +323,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
296162
55
4769