Update chai
Level up Chai! New ability unlocked: assert.isBelow(val, limit) // FREEBIE
This commit is contained in:
parent
080c233a93
commit
26df196aba
3 changed files with 11133 additions and 8703 deletions
File diff suppressed because it is too large
Load diff
9919
test/test.js
9919
test/test.js
File diff suppressed because it is too large
Load diff
|
@ -72,11 +72,11 @@ describe('TimestampView', function() {
|
||||||
|
|
||||||
it('updates at reasonable intervals', function() {
|
it('updates at reasonable intervals', function() {
|
||||||
var view = new Whisper.TimestampView();
|
var view = new Whisper.TimestampView();
|
||||||
assert(view.computeDelay(1000) < 60 * 1000); // < minute
|
assert.isBelow(view.computeDelay(1000), 60 * 1000); // < minute
|
||||||
assert.strictEqual(view.computeDelay(1000 * 60 * 5), 60 * 1000); // minute
|
assert.strictEqual(view.computeDelay(1000 * 60 * 5), 60 * 1000); // minute
|
||||||
assert.strictEqual(view.computeDelay(1000 * 60 * 60 * 5), 60 * 60 * 1000); // hour
|
assert.strictEqual(view.computeDelay(1000 * 60 * 60 * 5), 60 * 60 * 1000); // hour
|
||||||
|
|
||||||
assert(view.computeDelay(6 * 24 * 60 * 60 * 1000) < 7 * 24 * 60 * 60 * 1000); // < week
|
assert.isBelow(view.computeDelay(6 * 24 * 60 * 60 * 1000), 7 * 24 * 60 * 60 * 1000); // < week
|
||||||
|
|
||||||
// return falsey value for long ago dates that don't update
|
// return falsey value for long ago dates that don't update
|
||||||
assert.notOk(view.computeDelay(1000 * 60 * 60 * 24 * 8));
|
assert.notOk(view.computeDelay(1000 * 60 * 60 * 24 * 8));
|
||||||
|
|
Loading…
Reference in a new issue