Skip to content

Commit 0d9f53c

Browse files
committed
test: Fixed tests with error types on <= IE10
1 parent 2300983 commit 0d9f53c

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

test/integration/test.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ function parseUrl(url) {
3535
return out;
3636
}
3737

38+
function isBelowIE11() {
39+
return /*@cc_on!@*/ false == !false;
40+
}
41+
42+
function isEdge14() {
43+
return window.navigator.userAgent.indexOf('Edge/14') !== -1;
44+
}
45+
3846
describe('integration', function() {
3947
beforeEach(function(done) {
4048
this.iframe = createIframe(done);
@@ -277,7 +285,12 @@ describe('integration', function() {
277285
},
278286
function() {
279287
var ravenData = iframe.contentWindow.ravenData[0];
280-
assert.isTrue(/SyntaxError/.test(ravenData.exception.values[0].type)); // full message differs per-browser
288+
// ¯\_(ツ)_/¯
289+
if (isBelowIE11() || isEdge14()) {
290+
assert.equal(ravenData.exception.values[0].type, undefined);
291+
} else {
292+
assert.match(ravenData.exception.values[0].type, /SyntaxError/);
293+
}
281294
assert.equal(ravenData.exception.values[0].stacktrace.frames.length, 1); // just one frame
282295
}
283296
);
@@ -375,7 +388,12 @@ describe('integration', function() {
375388
},
376389
function() {
377390
var ravenData = iframe.contentWindow.ravenData[0];
378-
assert.match(ravenData.exception.values[0].type, /^Error/);
391+
// ¯\_(ツ)_/¯
392+
if (isBelowIE11() || isEdge14()) {
393+
assert.equal(ravenData.exception.values[0].type, undefined);
394+
} else {
395+
assert.match(ravenData.exception.values[0].type, /^Error/);
396+
}
379397
assert.match(ravenData.exception.values[0].value, /realError$/);
380398
assert.isAbove(ravenData.exception.values[0].stacktrace.frames.length, 0); // 1 or 2 depending on platform
381399
assert.match(

0 commit comments

Comments
 (0)