Skip to content
Permalink
Browse files

test, feat: only test util.format.

  • Loading branch information...
xicilion committed Sep 10, 2018
1 parent 74ebf67 commit 545e0803e92478dc7e692deba9c58a7134ebe655
Showing with 4 additions and 3 deletions.
  1. +4 −3 test/timer_test.js
@@ -5,6 +5,7 @@ var test_util = require('./test_util');

var coroutine = require("coroutine");
var timers = require("timers");
var util = require("util");

var os = require("os");

@@ -466,18 +467,18 @@ describe("timer", () => {
assert.lessThan(t2 - t1, 150);
});

it("native method", () => {
it("util.format", () => {
function test3() {
while (true)
console.log(new Date());
util.format(new Date());
}

var t1 = new Date();
assert.throws(() => {
timers.call(test3, 30);
});
var t2 = new Date();
assert.greaterThan(t2 - t1, 30);
assert.greaterThan(t2 - t1, 25);
assert.lessThan(t2 - t1, 100);
});

0 comments on commit 545e080

Please sign in to comment.
You can’t perform that action at this time.