query-engine
Version:
Query-Engine is a NoSQL and MongoDb compliant query engine. It can run on the server-side with Node.js, or on the client-side within web browsers
80 lines (66 loc) • 2.81 kB
JavaScript
// Generated by CoffeeScript 1.3.3
(function() {
var ConsoleReporter, ListReporter,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
ConsoleReporter = typeof require !== "undefined" && require !== null ? require(__dirname + '/console') : this.joe.ConsoleReporter;
ListReporter = (function(_super) {
__extends(ListReporter, _super);
ListReporter.prototype.startSuite = function() {};
ListReporter.prototype.finishSuite = function() {};
ListReporter.prototype.startTest = function() {
return ++this.total;
};
function ListReporter(config) {
var _base, _base1, _ref, _ref1;
this.config || (this.config = config || {});
if ((_ref = (_base = this.config).fail) == null) {
_base.fail = '✘ ';
}
if ((_ref1 = (_base1 = this.config).pass) == null) {
_base1.pass = '✔ ';
}
ListReporter.__super__.constructor.apply(this, arguments);
}
ListReporter.prototype.finishTest = function(suite, testName, err) {
var check, message;
if (err) {
this.errors.push({
suite: suite,
testName: testName,
err: err
});
++this.failed;
} else {
++this.passed;
}
testName = this.getTestName(suite, testName);
check = (err ? this.config.fail : this.config.pass);
message = "" + check + testName;
return console.log(message, (typeof process !== "undefined" && process !== null) === false && err ? [err, err.stack] : '');
};
ListReporter.prototype.exit = function() {
var err, error, index, suite, testName, _i, _len, _ref;
if (this.errors.length === 0) {
console.log("\n" + this.config.summaryPass, this.passed, this.total);
} else {
console.log("\n" + this.config.summaryFail, this.passed, this.total, this.errors.length);
_ref = this.errors;
for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
error = _ref[index];
suite = error.suite, testName = error.testName, err = error.err;
testName = this.getTestName(suite, testName);
console.log("\n" + this.config.failHeading, index + 1);
console.log("" + testName + "\n" + (err.stack.toString()));
}
}
return console.log('');
};
return ListReporter;
})(ConsoleReporter);
if (typeof module !== "undefined" && module !== null) {
module.exports = ListReporter;
} else {
this.joe.ListReporter = ListReporter;
}
}).call(this);