-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
38 lines (32 loc) · 1.14 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* week-seconds <https://github.com/datetime/week-seconds>
*
* Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
* Released under the MIT license.
*/
'use strict';
var assert = require('assert');
var weekSeconds = require('./index');
describe('week-seconds:', function() {
it('should get the number of milliseconds in a week, when no arguments', function(done) {
assert.strictEqual(weekSeconds(), 604800000);
done();
});
it('should get the number of seconds in a week, when true', function(done) {
assert.strictEqual(weekSeconds(true), 604800);
done();
});
it('should get the number of milliseconds in a week, when otherwise', function(done) {
assert.strictEqual(weekSeconds(), 604800000);
assert.strictEqual(weekSeconds(false), 604800000);
assert.strictEqual(weekSeconds(null), 604800000);
assert.strictEqual(weekSeconds([1,2,3]), 604800000);
assert.strictEqual(weekSeconds({obj:true}), 604800000);
assert.strictEqual(weekSeconds('str'), 604800000);
done();
});
it('should response be typeof number', function(done) {
assert(typeof weekSeconds() === 'number');
done();
})
});