diff --git a/test/index.test.js b/test/index.test.js index e9ced54..d7afc7e 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,26 +1,26 @@ -const assert = require('assert'); +const { ok, strictEqual: eq, throws } = require('assert'); const { describe, it } = require('zunit'); const { fake, real } = require('..'); describe('clocks', () => { it('fake clock should default to groundhog day', () => { - assert.equal(fake.now(), 1454410800000); + eq(fake.now(), 1454410800000); }); it('fake clock should fixed time', () => { - assert.equal(fake.fix(1469563181761).now(), 1469563181761); - assert.equal(fake.fix(new Date(1469563181761)).now(), 1469563181761); - assert.equal(fake.fix(new Date(1469563181761).toISOString()).now(), 1469563181761); + eq(fake.fix(1469563181761).now(), 1469563181761); + eq(fake.fix(new Date(1469563181761)).now(), 1469563181761); + eq(fake.fix(new Date(1469563181761).toISOString()).now(), 1469563181761); }); it('fake clock should reject attempts to fix time to an invalid value', () => { - assert.throws(() => { + throws(() => { fake.fix('foo'); }, /Invalid Date: foo/); }); it('real clock should use correct time', () => { - assert.ok(Math.abs(real.now() - Date.now()) < 100); + ok(Math.abs(real.now() - Date.now()) < 100); }); });