Skip to content

Commit 2fb8854

Browse files
Do not stop the whole test suite if it fails to parse the JSON response
1 parent b68e966 commit 2fb8854

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/utils.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@
9090
if ( !content ) {
9191
ok(false, [
9292
'"' + requestURL + '"',
93-
'should return an object literal in the content body',
94-
'with name and value keys'
93+
'content should not be empty'
9594
].join(' '));
9695
done();
9796
return;
9897
}
99-
var result = JSON.parse(content);
100-
callback(result.value, iframeDocument.cookie);
101-
done();
98+
try {
99+
var result = JSON.parse(content);
100+
callback(result.value, iframeDocument.cookie);
101+
} finally {
102+
done();
103+
}
102104
});
103105
iframe.src = requestURL;
104106
}

0 commit comments

Comments
 (0)