Switch to QUnit 1.20 (bower), and implement a workaround for hidepassed issues.

This commit is contained in:
Jürg Lehni 2015-12-28 21:15:10 +01:00
parent 7328e829b7
commit e9d575e8b1
4 changed files with 16 additions and 3 deletions

View file

@ -26,6 +26,7 @@
"devDependencies": {
"straps": "~1.7.2",
"acorn": "~0.5.0",
"qunit": "~1.20.0",
"stats.js": "r14"
},
"keywords": [

View file

@ -36,7 +36,6 @@
"gulp": "^3.9.0",
"gulp-qunit": "^1.2.1",
"prepro": "~0.9.1",
"qunitjs": "~1.15.0",
"uglify-js": "~2.4.24"
},
"keywords": [

View file

@ -2,8 +2,8 @@
<html>
<head>
<title>Paper.js Tests</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
<script type="text/javascript" src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../bower_components/qunit/qunit/qunit.css">
<script type="text/javascript" src="../bower_components/qunit/qunit/qunit.js"></script>
<script type="text/javascript" src="js/helpers.js"></script>
<script type="text/javascript" src="../src/load.js"></script>
<script type="text/javascript" src="tests/load.js"></script>

View file

@ -10,6 +10,19 @@
* All rights reserved.
*/
// Until window.history.pushState() works when running locally, we need to trick
// qunit into thinking that the feature is not present. This appears to work...
// TODO: Ideally we should fix this in QUnit instead.
delete window.history;
window.history = {};
QUnit.begin(function() {
if (/hidepassed/.test(document.location.href)) {
QUnit.config.hidepassed = true;
document.getElementById('qunit-tests').className += ' hidepass';
}
});
// Register a jsDump parser for Base.
QUnit.jsDump.setParser('Base', function (obj, stack) {
// Just compare the string representation of classes inheriting from Base,