Debian Codegraph @

test/lib/logger.js

raw
1 "use strict";
2
3 module.exports = function (t, a) {
4 var ondata = [], ended = false;
5 t = t();
6 t.on("data", function (o) { ondata.push(o.type, o.data); });
7 t.on("end", function () { ended = true; });
8 t.pass("foo");
9 t.in("ONE");
10 t.fail("bar");
11 t.out();
12 t.error("error");
13
14 a.deep(t.msg, [], "Msg");
15 a(t.length, 3, "Length");
16 a.deep([t[0].type, t[0].data, t[0].msg.toString()], ["pass", "foo", ""], "#1 pass");
17 a.deep([t[1].type, t[1].data, t[1].msg.toString()], ["fail", "bar", "ONE"], "#2 fail");
18 a.deep([t[2].type, t[2].data, t[2].msg.toString()], ["error", "error", ""], "#3 error");
19 a(ended, false, "Not ended");
20 t.end();
21 a(ended, true, "Ended");
22 a.deep(ondata, ["pass", "foo", "fail", "bar", "error", "error"], "Log");
23 };