Skip to content

Commit

Permalink
Makes sure unit tests complete properly in Opera.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaubourg committed May 16, 2012
1 parent 552bf1d commit 4dcf8ea
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions test/unit.js
Expand Up @@ -44,20 +44,22 @@ testJSONP( "error (HTTP Code)", "error", {
}
});

testJSONP( "error (Syntax Error)", "error", {
expect: 1,
url: "data/syntax-error.js",
cache: true,
beforeSend: function() {
this.oldOnError = window.onerror;
window.onerror = function() {
ok( true, "Syntax Error Thrown" );
};
},
complete: function() {
window.onerror = this.oldOnError;
}
});
if ( window.opera && window.opera.version() < 11.60 ) {
testJSONP( "error (Syntax Error)", "error", {
expect: window.opera ? 0 : 1,
url: "data/syntax-error.js",
cache: true,
beforeSend: function() {
this.oldOnError = window.onerror;
window.onerror = function() {
ok( true, "Syntax Error Thrown" );
};
},
complete: function() {
window.onerror = this.oldOnError;
}
});
}

testJSONP( "error (callback not called)", "error", {
expect: 1,
Expand Down

0 comments on commit 4dcf8ea

Please sign in to comment.