Skip to content

Commit

Permalink
Refine fix for running tests in old IEs
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Feb 16, 2018
1 parent 8d9dbf3 commit e56c990
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@
window.lifecycle = {
afterEach: function () {
// Remove the cookies created using js-cookie default attributes
Object.keys(Cookies.get()).forEach(Cookies.remove);
// Note: Using `Object.keys(Cookies.get()).forEach(Cookies.remove)`
// would cause IE 6 + 7 to break with a "Object doesn't support
// this property or method" error, thus wrapping it with a
// function.
Object.keys(Cookies.get()).forEach(function (cookie) {
Cookies.remove(cookie);
});
// Remove the cookies created using browser default attributes
Object.keys(Cookies.get()).forEach(function (cookie) {
Cookies.remove(cookie, {
Expand Down

0 comments on commit e56c990

Please sign in to comment.