Skip to content

Commit cb65111

Browse files
committed
tests/utils/ajax: Allow both Chrome versions to pass the test
1 parent 281d37e commit cb65111

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/utils/ajax-test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,17 @@ module('ajax()', function (hooks) {
103103
assert.true(error.isJsonError);
104104
assert.false(error.isNetworkError);
105105

106+
let expectedCauseMessages = [
107+
// Chrome < 104
108+
'Unexpected token f in JSON at position 2',
109+
// Chrome >= 104
110+
"Expected property name or '}' in JSON at position 2",
111+
];
112+
106113
let { cause } = error;
107114
assert.ok(!(cause instanceof HttpError));
108115
assert.equal(cause.name, 'SyntaxError');
109-
assert.equal(cause.message, "Expected property name or '}' in JSON at position 2");
116+
assert.ok(expectedCauseMessages.includes(cause.message));
110117
return true;
111118
});
112119
});

0 commit comments

Comments
 (0)