Krinkle on master
CLI: Upgrade `commander` to 2.6… (compare)
Krinkle on master
CLI: Upgrade `commander` to 2.6… Update package-lock.json (compare)
Krinkle on master
Docs: Fix bad issue reference i… (compare)
Krinkle on Krinkle-patch-1
Krinkle on Krinkle-patch-1
Docs: Fix bad issue reference i… (compare)
(function(global) {
var timer = new java.util.Timer();
var counter = 1;
var ids = {};
global.setTimeout = function(fn, delay) {
var id = counter;
counter += 1;
ids[id] = new JavaAdapter(java.util.TimerTask, { run : fn });
if (!delay) {delay = 1;}
timer.schedule(ids[id], delay);
return id;
};
global.clearTimeout = function(id) {
ids[id].cancel();
timer.purge();
delete ids[id];
};
global.setInterval = function(fn, delay) {
var id = counter;
counter += 1;
ids[id] = new JavaAdapter(java.util.TimerTask, { run : fn });
if (!delay) {delay = 1;}
timer.schedule(ids[id], delay, delay);
return id;
};
global.clearInterval = global.clearTimeout;
// exports object in case of "isCommonJS"
global.exports = {};
})(this);
load("D:/Webstorm-Workspace/Script-Test-Ranch/libs/qunit/qunit-2.9.2.js")
QUnit = exports.QUnit;
QUnit.config.blocking = false;
QUnit.config.autorun = false;
QUnit.config.updateRate = 0;
QUnit.config.showSuccess = true;
QUnit.begin(function( details ) {
print( "Test amount:", details.totalTests );
});
QUnit.testStart(function( details ) {
print( "Now running: ", details.module, details.name );
});
QUnit.done(function( details ) {
print("Total: " + details.total + " Failed: " + details.failed + " Passed: " + details.passed);
});
QUnit.log(function( details ){
var testResult, runtime;
if (details.result) {
testResult = "success";
} else {
testResult = "FAILED";
}
if (details.runtime !== undefined && details.runtime !== null) {
runtime = " [" + details.runtime + " ms] ";
}
var loc = " " + details.module + ": " + details.name + ": ";
output = testResult + runtime + " " + loc + (details.message ? details.message + ", " : "");
if (details.actual) {
output += "expected: " + details.expected + ", actual: " + details.actual;
}
if (details.source) {
output += ", " + details.source;
}
print(output);
});
QUnit.module( "First Test");
QUnit.test( "ok test", function( assert ) {
assert.ok( true, "true succeeds" );
assert.ok( "non-empty", "non-empty string succeeds" );
assert.ok( false, "false fails" );
assert.ok( 0, "0 fails" );
assert.ok( NaN, "NaN fails" );
assert.ok( "", "empty string fails" );
assert.ok( null, "null fails" );
assert.ok( undefined, "undefined fails" );
});
QUnit.module( "Second Test");
QUnit.test( "ok test", function( assert ) {
assert.ok( true, "true succeeds" );
assert.ok( "non-empty", "non-empty string succeeds" );
assert.ok( false, "false fails" );
assert.ok( 0, "0 fails" );
assert.ok( NaN, "NaN fails" );
assert.ok( "", "empty string fails" );
assert.ok( null, "null fails" );
assert.ok( undefined, "undefined fails" );
});
QUnit.start();
Error: No tests were run.
hooks.setup
and hooks.teardown
, or were those only on module calls with an object argument rather than the callback function?
git grep qunitjs
should find any places that might need an update.
QUnit
object, which has not changed. and the CLI command is still called qunit
, same as before.
that makes sense, thanks.
i started implementing that, then realized that this is probably true of other browsers too. should we have a utility (maybe something near globals.js) to warn about certain deprecated browsers? we have a lot of scaffolding and fallthroughs for the older envs, so we could warn when we know we've had to gracefully degrade/polyfill.
i guess my point is, i assume we'd want to warn for each browser we want to drop in 3.0, but not produce too much noise for warning at every turn. if that outlook is agreeable, i can work on that and propose a PR
that sounds fair about the browser support - PhantomJS could surprise some folks, and I can issue a warning for that. I'll leave the broader "this browser will be deprecated" can-of-worms alone....
and thanks for touching up the coveralls. I loooooove a green coverage report :-)
does anyone have a go-to grunt task to run QUnit node tests?
i've found grunt-qunit-node, grunt-node-qunit (both very old), grunt-contrib-qunit (but that's just for HTML browser tests), and then there's https://github.com/qunitjs/node-qunit, which looks maintained, though still uses some 1.x globals in the readme, and I wasn't sure how easy it was to pull that into Grunt ecosystems...
npm test
idiom and get it the same way as otherwise.
require("qunit")
and run that, which is missing a lot of protections and debug utilities. I wouldn't recommend it personally
qunit ./test/*.js
or simply qunit
from the test command.