How to use the qunit.options 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 biril / backbone-faux-server / test / testrunner.js View on Github external
summary: true,

    // log global summary (all files)
    // globalSummary: true,

    // log coverage
    coverage: true,

    // log global coverage (all files)
    // globalCoverage: true,

    // log currently testing code file
    testing: true
};

qunit.options.coverage = { dir: "coverage" };

qunit.run({
    code: { path: absPath("../backbone-faux-server.js"), namespace: "fauxServer" },
    tests: [
        absPath("test-version.js"),
        absPath("test-routes.js"),
        absPath("test-urlexpmatch.js"),
        absPath("test-handlers.js"),
        absPath("test-sync.js"),
        absPath("test-eventscallbacks.js"),
        absPath("test-transportcustom.js"),
        absPath("test-chain.js")
    ]
}, function (error, stats) {
    if (error) {
        console.error(new Error(error));
github biril / backbone-faux-server / test / testrunner.js View on Github external
/*jshint node:true */
"use strict";
var qunit = require("qunit"),
    absPath = (function () {
        var joinPaths = require("path").join;
        return function (relPath) {
            return joinPaths(__dirname, relPath);
        };
    }());

qunit.options.deps = [{
    path: absPath("../node_modules/underscore/underscore.js"),
    namespace: "_"
}, {
    path: absPath("../node_modules/backbone/backbone.js"),
    namespace: "Backbone"
}];

qunit.options.log = {
    // log assertions overview
    assertions: false,

    // log expected and actual values for failed tests
    errors: true,

    // log tests overview
    tests: true,
github komola / paymill-node / tests / test_runner.js View on Github external
var util = require('util');
var testrunner = require('qunit');

// change any option for all tests globally
testrunner.options.log = {
  // log assertions overview
  assertions : false,
  // log expected and actual values for failed tests
  errors : true,
  // log tests overview
  tests : true,
  // log summary
  summary : true,
  // log global summary (all files)
  globalSummary : false,
  // log currently testing code file
  testing : false
};

var callback = function (err, report) {
  if (err) {
github multiplex / multiplex.js / tasks / qunit.js View on Github external
grunt.task.registerTask('qtest', 'run all unit tests', function () {
        var done = this.async(),
            dirs = grunt.config('dirs'),
            files = grunt.config('files'),
            qrunner = require('qunit'),
            path = require('path');


        // configure qrunner
        qrunner.options.log.assertions = false;
        qrunner.options.log.tests = false;
        qrunner.options.log.summary = false;
        qrunner.options.log.testing = false;
        qrunner.options.maxBlockDuration = 120000;

        qrunner.run({
            code: { path: path.join(dirs.build, files.main), namespace: 'mx' },
            tests: [path.join(dirs.build, dirs.test, files.testrunner)]
        }, function (err, report) {
            if (err) {
                console.log('Oops', err, report);
                done(err);
                return;
            }

            if (report.failed !== 0) {
github multiplex / multiplex.js / tasks / qunit.js View on Github external
grunt.task.registerTask('qtest', 'run all unit tests', function () {
        var done = this.async(),
            dirs = grunt.config('dirs'),
            files = grunt.config('files'),
            qrunner = require('qunit'),
            path = require('path');


        // configure qrunner
        qrunner.options.log.assertions = false;
        qrunner.options.log.tests = false;
        qrunner.options.log.summary = false;
        qrunner.options.log.testing = false;
        qrunner.options.maxBlockDuration = 120000;

        qrunner.run({
            code: { path: path.join(dirs.build, files.main), namespace: 'mx' },
            tests: [path.join(dirs.build, dirs.test, files.testrunner)]
        }, function (err, report) {
            if (err) {
                console.log('Oops', err, report);
                done(err);
                return;
            }

            if (report.failed !== 0) {
                err = new Error(report.failed + ' tests failed');
            }
            done(err);
        });
github keithamus / tempus / grunt.js View on Github external
// 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 sasadjolic / dom-terminal / test / index.js View on Github external
qunit = require('qunit');
qunit.options.log.assertions = false;
qunit.options.log.errors = false;
qunit.options.log.tests = false;
qunit.options.log.summary = false;
qunit.options.log.globalSummary = false;
qunit.run({
	code: {
		path: './lib/terminal.js',
		namespace: 'Terminal'
	},
	tests: [
		'terminal.test.js'
	].map(function (v) { return './test/' + v })
}, function(err, report) {
	var assertions = qunit.log.assertion();
	for (var i in assertions) {
		var assertion = assertions[i];
		if (!assertion.result) {
			console.log(assertion);
		}
github sasadjolic / dom-terminal / test / index.js View on Github external
qunit = require('qunit');
qunit.options.log.assertions = false;
qunit.options.log.errors = false;
qunit.options.log.tests = false;
qunit.options.log.summary = false;
qunit.options.log.globalSummary = false;
qunit.run({
	code: {
		path: './lib/terminal.js',
		namespace: 'Terminal'
	},
	tests: [
		'terminal.test.js'
	].map(function (v) { return './test/' + v })
}, function(err, report) {
	var assertions = qunit.log.assertion();
	for (var i in assertions) {
		var assertion = assertions[i];
github keithamus / tempus / test / index.js View on Github external
var qunit = require('qunit');

function testpath(p) {
    return './test/tempus.test.' + p + '.js';
}

qunit.options.globalSummary = false;


var tests = [
    'creation',
    'originalMethods',
    'dateMethods',
    'utilityMethods',
    'yearMethods',
    'monthMethods',
    'weekMethods',
    'dayMethods',
    'timeMethods',
    'stringMethods',
    'highLevelFunctionality',
    'timer'
];
github SphtKr / homebridge-zway / tests / js / runner.js View on Github external
var qunit = require("qunit");
homebridge = require("../../node_modules/homebridge/lib/api.js");

qunit.options.coverage = { dir: "/tmp/" };

qunit.run({
  code : "index.js",
  tests : [
    'switchBinary',
    'issue-48.js',
    'issue-69.js',
    'issue-72.js',
    'issue-70.js',
    'update-without-change.js'
  ].map(function (v) { return './tests/js/' + v; })
});