Move test error catching code before any other script files.

This commit is contained in:
John-David Dalton
2014-05-28 11:58:18 -04:00
parent 7cb47c8494
commit a893d43d16
3 changed files with 33 additions and 21 deletions

View File

@@ -11,6 +11,17 @@
</style>
</head>
<body>
<script>
// avoid reporting tests to Sauce Labs when script errors occur
if (location.port == '9001') {
window.onerror = function(message) {
if (window.QUnit) {
QUnit.config.done.length = 0;
}
global_test_results = { 'message': message };
};
}
</script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
@@ -154,13 +165,6 @@
QUnit.config.hidepassed = true;
// avoid reporting tests to Sauce Labs when script errors occur
if (ui.isSauceLabs) {
window.onerror = function(message) {
QUnit.config.done.length = 0;
global_test_results = { 'message': message };
};
}
// load Lo-Dash and expose it to the bad extensions/shims
if (!ui.isModularize) {
addBizarroMethods();