UNPKG

compound-ex4

Version:

Compound-ex4 - MVC framework for NodeJS (ExpressJs 4 version), fork compoundjs(https://github.com/1602/compound)

34 lines (30 loc) 728 B
var tap = require("../") tap.test("timeout test with plan only", function (t) { console.error("timeout test") t.plan(2) console.error("t.plan="+t._plan) setTimeout(function () { console.error("a assert") t.ok(true, "a") }, 1000) setTimeout(function () { console.error("b assert") t.ok(true, "b") }, 1000) }) tap.test("timeout test with plan and end", function (t) { console.error("timeout test") t.plan(2) var tc = 2 console.error("t.plan="+t._plan) setTimeout(function () { console.error("a assert") t.ok(true, "a") if (-- tc === 0) t.end() }, 1000) setTimeout(function () { console.error("b assert") t.ok(true, "b") if (-- tc === 0) t.end() }, 1000) })