Skip to content

Commit 0464605

Browse files
Fixed some failing tests on Internet Explorer
1 parent ee9d38a commit 0464605

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function configureSauceLabs(config) {
152152
base: 'SauceLabs',
153153
platform: 'Windows 7',
154154
browserName: 'internet explorer',
155-
version: '10'
155+
version: '9'
156156
},
157157
'IE-Edge': {
158158
base: 'SauceLabs',

tests/fixtures/config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
mocha.setup('bdd');
77
mocha.fullTrace();
88
mocha.checkLeaks();
9-
mocha.globals([]);
9+
mocha.globals(['$0', '$1', '$2', '$3', '$4', '$5']);
1010
}
1111

1212
// Set global settings for all tests
1313
beforeEach(function() {
14-
this.currentTest.timeout(2000);
15-
this.currentTest.slow(100);
14+
// Most of our tests perform multiple AJAX requests,
15+
// so we need to increase the timeouts to allow for that
16+
this.currentTest.timeout(slowEnvironment ? 10000 : 2000);
17+
this.currentTest.slow(500);
1618
});
1719

1820
})();

tests/fixtures/globals.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
isNode: false,
1818
isBrowser: true
1919
};
20+
21+
// Flag known slow environments (TravisCI and SauceLabs)
22+
global.slowEnvironment = !!window.__karma__;
2023
}
2124
else {
2225
// Expose Node globals
@@ -27,7 +30,10 @@
2730
global.userAgent = {
2831
isNode: true,
2932
isBrowser: false
30-
}
33+
};
34+
35+
// Flag known slow environments (TravisCI and SauceLabs)
36+
global.slowEnvironment = !!process.env.TRAVIS;
3137
}
3238

3339
})();

tests/fixtures/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
* Converts Buffer objects to POJOs, so they can be compared using Chai
8989
*/
9090
helper.convertNodeBuffersToPOJOs = function convertNodeBuffersToPOJOs(value) {
91-
if (value && value.constructor && value.constructor.name === 'Buffer') {
91+
if (value && (value._isBuffer || (value.constructor && value.constructor.name === 'Buffer'))) {
9292
// Convert Buffers to POJOs for comparison
9393
value = value.toJSON();
9494

0 commit comments

Comments
 (0)