A library for running qunit tests on a local machine and in the SauceLabs environment.
npm install qunit-harness$ npm install qunit-harness
js
var QUnitHarness = require('qunit-harness');
function configQunitServerApp (app) {
app.post('/my-custom-request', function (req, res) {
res.end('ok');
});
}
function before () {
// do some stuff when the server is created
}
function after () {
// do some stuff when the server is about to be closed
}
//Local machine testing
var qunitHarness = new QUnitHarness
//specify the path to the tests
.fixtures('/tests/')
//specify qunit server ports
.port(2000) //by default 1335
.crossDomainPort(2001) //by default 1336
//add the index.js script content as