Skip to content

Commit e56c990

Browse files
committed
Refine fix for running tests in old IEs
1 parent 8d9dbf3 commit e56c990

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
window.lifecycle = {
3636
afterEach: function () {
3737
// Remove the cookies created using js-cookie default attributes
38-
Object.keys(Cookies.get()).forEach(Cookies.remove);
38+
// Note: Using `Object.keys(Cookies.get()).forEach(Cookies.remove)`
39+
// would cause IE 6 + 7 to break with a "Object doesn't support
40+
// this property or method" error, thus wrapping it with a
41+
// function.
42+
Object.keys(Cookies.get()).forEach(function (cookie) {
43+
Cookies.remove(cookie);
44+
});
3945
// Remove the cookies created using browser default attributes
4046
Object.keys(Cookies.get()).forEach(function (cookie) {
4147
Cookies.remove(cookie, {

0 commit comments

Comments
 (0)