From 72f845f1971201ef23c40fcb6fbc9c8e187486bc Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 4 Feb 2016 21:12:56 +0100 Subject: [PATCH] test(client): Fixes for ie7 --- test/client/karma.spec.js | 8 +++++--- test/client/stringify.spec.js | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/client/karma.spec.js b/test/client/karma.spec.js index 8fcec0575..f5669e847 100644 --- a/test/client/karma.spec.js +++ b/test/client/karma.spec.js @@ -339,9 +339,11 @@ describe('Karma', function () { k.complete() - clock.tick(20) - - assert.notEqual(iframe.src, CURRENT_URL) + // clock.tick() does not work in IE 7 + setTimeout(function () { + clock.tick(1) + assert.notEqual(iframe.src, CURRENT_URL) + }, 10) }) it('should not clear context window upon complete when clearContext config is false', function () { diff --git a/test/client/stringify.spec.js b/test/client/stringify.spec.js index 5127f46b2..ecd44d4b4 100644 --- a/test/client/stringify.spec.js +++ b/test/client/stringify.spec.js @@ -54,10 +54,14 @@ describe('stringify', function () { assert(stringify(obj).indexOf("{a: 'a'}") > -1) obj = {constructor: null} - assert(stringify(obj).indexOf('{constructor: null}') > -1) + + // IE 7 serializes this to Object{} + var s = stringify(obj) + assert(s.indexOf('{constructor: null}') > -1 || s.indexOf('Object{}') > -1) obj = Object.create(null) obj.a = 'a' + assert(stringify(obj).indexOf("{a: 'a'}") > -1) })