| 1 |
"use strict"; |
| 2 |
|
| 3 |
var customError = require("es5-ext/error/custom") |
| 4 |
, logger = require("../../lib/logger")(); |
| 5 |
|
| 6 |
module.exports = function (t, a) { |
| 7 |
t = t(logger); |
| 8 |
t(true, true, "foo"); |
| 9 |
t.ok(false, "bar"); |
| 10 |
t.not(false, true, "not"); |
| 11 |
t.deep([1, 2], [1, 2], "deep"); |
| 12 |
t.notDeep([1, 2], [2, 1], "not deep"); |
| 13 |
t.throws(function () { throw customError("Test", "TEST"); }, "TEST", "throws"); |
| 14 |
|
| 15 |
a.deep([logger[0].type, logger[0].data], ["pass", "foo"]); |
| 16 |
a.deep([logger[1].type, logger[1].data.message], ["fail", "bar"]); |
| 17 |
a.deep([logger[2].type, logger[2].data], ["pass", "not"], "'not' support"); |
| 18 |
a.deep([logger[3].type, logger[3].data], ["pass", "deep"], "'deep' support"); |
| 19 |
a.deep([logger[4].type, logger[4].data], ["pass", "not deep"], "'not deep' support"); |
| 20 |
a.deep([logger[5].type, logger[5].data], ["pass", "throws"], "custom trhows support"); |
| 21 |
}; |