Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
, tests = [];
// Filter tests down if given args
if (this.args.length > 0) {
grunt.log.writeln('Filtering to ' + this.args);
this.args.forEach(function (test) {
if (testFiles.indexOf(test) !== -1) {
tests.push(test);
}
});
} else {
tests = testFiles;
}
// Node-Qunit shouldn’t log stuff
nodequnit.log.stats = nodequnit.log.reset = nodequnit.log.print = function () {};
nodequnit.options = {
assertions: false,
errors: false,
tests: false,
summary: false,
globalSummary: false,
coverage: false,
deps: null,
namespace: null
};
// We'll collect up all of the failed assertions
var failures = [];
nodequnit.log.assertion = function (o) {
if (!o.result) {
failures.push(o);
// We'll collect up all of the failed assertions
var failures = [];
nodequnit.log.assertion = function (o) {
if (!o.result) {
failures.push(o);
}
};
// Grab the final stats
var stats = {};
nodequnit.log.summary = function (o) {
stats = o;
};
// Marker for tests
nodequnit.log.test = function (result) {
grunt.log.write(+result.failed > 0 ? 'F'.red : '.');
};
// Run the tests
nodequnit.run({
code: { path: './test/node.test.bootstrap.js', namespace: 'Tempus' },
tests: tests.map(function (f) { return './test/tempus.test.' + f + '.js'; })
}, function () {
// Log out all failures.
grunt.log.writeln();
failures.forEach(function (failure) {
grunt.log.error((failure.module ? failure.module + ' - ' : '') + failure.test);
if (failure.message) {
grunt.log.error('Message: ' + String(failure.message).magenta);
}
if (failure.actual !== failure.expected) {
coverage: false,
deps: null,
namespace: null
};
// We'll collect up all of the failed assertions
var failures = [];
nodequnit.log.assertion = function (o) {
if (!o.result) {
failures.push(o);
}
};
// Grab the final stats
var stats = {};
nodequnit.log.summary = function (o) {
stats = o;
};
// Marker for tests
nodequnit.log.test = function (result) {
grunt.log.write(+result.failed > 0 ? 'F'.red : '.');
};
// Run the tests
nodequnit.run({
code: { path: './test/node.test.bootstrap.js', namespace: 'Tempus' },
tests: tests.map(function (f) { return './test/tempus.test.' + f + '.js'; })
}, function () {
// Log out all failures.
grunt.log.writeln();
failures.forEach(function (failure) {
// Node-Qunit shouldn’t log stuff
nodequnit.log.stats = nodequnit.log.reset = nodequnit.log.print = function () {};
nodequnit.options = {
assertions: false,
errors: false,
tests: false,
summary: false,
globalSummary: false,
coverage: false,
deps: null,
namespace: null
};
// We'll collect up all of the failed assertions
var failures = [];
nodequnit.log.assertion = function (o) {
if (!o.result) {
failures.push(o);
}
};
// Grab the final stats
var stats = {};
nodequnit.log.summary = function (o) {
stats = o;
};
// Marker for tests
nodequnit.log.test = function (result) {
grunt.log.write(+result.failed > 0 ? 'F'.red : '.');
};
qunit.run(tests, function(err) {
if (err) console.log(err.stack)
process.exit(err || qunit.log.stats().failed > 0 ? 1 : 0)
})
QUnit.testStart(function testStart (testDetails) {
QUnit.log = function qUnitLog (details) {
if (!details.result) {
details.name = testDetails.name;
log.push(details);
}
};
});
QUnit.testStart(function(testDetails){
QUnit.log = function(details){
if (!details.result) {
details.name = testDetails.name;
log.push(details);
}
};
});
return msg
}
function stacktrace(e){
if (e.stack)
return e.stack
return undefined
}
QUnit.begin(function(details) {
if (details.totalTests >= 1) {
log('1..' + details.totalTests);
}
});
QUnit.log( function(params, e){
if (e){
currentTest.items.push({
passed: params.result,
line: lineNumber(e),
file: sourceFile(e),
stack: stacktrace(e),
message: message(e)
})
} else{
if(params.result) {
currentTest.items.push({
passed: params.result,
message: params.message
})
}
else {