diff --git a/test/backbone.html b/test/backbone.html
index 95c12d7a8..b603952c1 100644
--- a/test/backbone.html
+++ b/test/backbone.html
@@ -42,6 +42,13 @@
}
};
+ // 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
if (!ui.isModularize) {
document.write('