aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarak <[email protected]>2021-02-08 23:40:31 -0500
committerGitHub <[email protected]>2021-02-08 23:40:31 -0500
commite3af59ca0440a8bd043392a9147a366df0d10804 (patch)
tree4fd1a6121a3a6ee6e06fe7477db7a0a1baafac76 /test
parent649e552a7d73db8f4079de96038d7de12f7afd8c (diff)
parent9dc301f22680ff7edaf0c0b68e001281ff4b9ac7 (diff)
downloadfaker-e3af59ca0440a8bd043392a9147a366df0d10804.tar.xz
faker-e3af59ca0440a8bd043392a9147a366df0d10804.zip
Merge pull request #775 from borel/master
Get x dates between two dates
Diffstat (limited to 'test')
-rw-r--r--test/date.unit.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/date.unit.js b/test/date.unit.js
index c3f4eb6c..c4569d54 100644
--- a/test/date.unit.js
+++ b/test/date.unit.js
@@ -115,6 +115,19 @@ describe("date.js", function () {
});
});
+ describe("betweens()", function () {
+ it("returns an array of 3 dates ( by default ) of sorted randoms dates between the dates given", function () {
+
+ var from = new Date(1990, 5, 7, 9, 11, 0, 0);
+ var to = new Date(2000, 6, 8, 10, 12, 0, 0);
+
+ var dates = faker.date.betweens(from, to );
+
+ assert.ok(dates[0] > from && dates[0] < to);
+ assert.ok(dates[1] > dates[0] && dates[2] > dates[1]);
+ });
+ });
+
describe("month()", function () {
it("returns random value from date.month.wide array by default", function () {
var month = faker.date.month();