Skip to content

Commit f2d1d29

Browse files
committed
Actually catch the error in the Syntax Error unit test.
1 parent e9b3274 commit f2d1d29

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/unit.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ test( "error (HTTP Code)", function() {
4242

4343
test( "error (Syntax Error)", function() {
4444
stop();
45-
expect( 1 );
45+
expect( 2 );
46+
var oldOnError = window.onerror;
47+
window.onerror = function() {
48+
ok( true, "Syntax Error Thrown" );
49+
return false;
50+
};
4651
$.jsonp({
4752
url: "data/syntax-error.js",
4853
cache: true,
@@ -53,6 +58,7 @@ test( "error (Syntax Error)", function() {
5358
ok( true, "Error" );
5459
},
5560
complete: function() {
61+
window.onerror = oldOnError;
5662
start();
5763
}
5864
});

0 commit comments

Comments
 (0)