How to use the qunit.log function in qunit

To help you get started, we’ve selected a few qunit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keithamus / tempus / grunt.js View on Github external
,   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);
github keithamus / tempus / grunt.js View on Github external
// 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) {
github keithamus / tempus / grunt.js View on Github external
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) {
github keithamus / tempus / grunt.js View on Github external
// 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 : '.');
        };
github kof / kiipost / testrunner.js View on Github external
qunit.run(tests, function(err) {
    if (err) console.log(err.stack)
    process.exit(err || qunit.log.stats().failed > 0 ? 1 : 0)
})
github ExactTarget / fuelux / test / tests.js View on Github external
QUnit.testStart(function testStart (testDetails) {
		QUnit.log = function qUnitLog (details) {
			if (!details.result) {
				details.name = testDetails.name;
				log.push(details);
			}
		};
	});
github ExactTarget / fuelux / test / tests-no-moment.js View on Github external
QUnit.testStart(function(testDetails){
		QUnit.log = function(details){
			if (!details.result) {
				details.name = testDetails.name;
				log.push(details);
			}
		};
	});
github brzpegasus / ember-cli-nwjs / test-support / node-webkit / qunit-logger.js View on Github external
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 {