Skip to content

Commit 3dc10e4

Browse files
committed
Switch to Jasmine 2 for testing. Fixes ajax testing in IE9
1 parent 8865df5 commit 3dc10e4

10 files changed

+224
-264
lines changed

dist/stacktrace-with-polyfills.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace-with-polyfills.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

karma.conf.ci.js

Lines changed: 66 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,77 @@ module.exports = function (config) {
88
// Commented some of these out just so CI doesn't take forever.
99
// Check out https://saucelabs.com/platforms for all browser/platform combos
1010
var customLaunchers = {
11-
//slIOS7: {
12-
// base: 'SauceLabs',
13-
// browserName: 'iPhone',
14-
// platform: 'OS X 10.9',
15-
// version: '7.1'
16-
//},
1711
slIOS8: {
1812
base: 'SauceLabs',
1913
browserName: 'iPhone',
20-
platform: 'OS X 10.9',
21-
version: '8.1'
14+
platform: 'OS X 10.10',
15+
version: '8.4'
16+
},
17+
slIOS9: {
18+
base: 'SauceLabs',
19+
browserName: 'iPhone',
20+
platform: 'OS X 10.11',
21+
version: '9.1'
22+
},
23+
slAndroid4: {
24+
base: 'SauceLabs',
25+
browserName: 'Android',
26+
platform: 'Linux',
27+
version: '4.4'
28+
},
29+
slAndroid5: {
30+
base: 'SauceLabs',
31+
browserName: 'Android',
32+
platform: 'Linux',
33+
version: '5.1'
2234
},
23-
//slAndroid4: {
24-
// base: 'SauceLabs',
25-
// browserName: 'Android',
26-
// platform: 'Linux',
27-
// version: '4.4'
28-
//},
2935
slChrome: {
3036
base: 'SauceLabs',
3137
browserName: 'chrome'
3238
},
33-
slFirefox: {
39+
slChromeBeta: {
3440
base: 'SauceLabs',
35-
browserName: 'firefox'
41+
browserName: 'chrome',
42+
version: 'beta'
43+
},
44+
slChromeCanary: {
45+
base: 'SauceLabs',
46+
browserName: 'chrome',
47+
version: 'dev'
48+
},
49+
slFirefox42: {
50+
base: 'SauceLabs',
51+
browserName: 'firefox',
52+
platform: 'Windows 8.1',
53+
version: '42.0'
54+
},
55+
slFirefoxDev: {
56+
base: 'SauceLabs',
57+
browserName: 'firefox',
58+
version: 'dev'
59+
},
60+
slSafari8: {
61+
base: 'SauceLabs',
62+
browserName: 'safari',
63+
platform: 'OS X 10.10',
64+
version: '8'
65+
},
66+
slSafari9: {
67+
base: 'SauceLabs',
68+
browserName: 'safari',
69+
platform: 'OS X 10.11',
70+
version: '9'
3671
},
37-
//slSafari6: {
38-
// base: 'SauceLabs',
39-
// browserName: 'safari',
40-
// platform: 'OS X 10.8',
41-
// version: '6'
42-
//},
43-
//slSafari7: {
44-
// base: 'SauceLabs',
45-
// browserName: 'safari',
46-
// platform: 'OS X 10.9',
47-
// version: '7'
48-
//},
49-
//slSafari8: {
50-
// base: 'SauceLabs',
51-
// browserName: 'safari',
52-
// platform: 'OS X 10.10',
53-
// version: '8'
54-
//}
5572
slOpera: {
5673
base: 'SauceLabs',
5774
browserName: 'opera'
5875
},
76+
slEdge20: {
77+
base: 'SauceLabs',
78+
browserName: 'microsoftedge',
79+
platform: 'Windows 10',
80+
version: '20.10240'
81+
},
5982
slIE11: {
6083
base: 'SauceLabs',
6184
browserName: 'internet explorer',
@@ -67,36 +90,31 @@ module.exports = function (config) {
6790
browserName: 'internet explorer',
6891
platform: 'Windows 8',
6992
version: '10'
93+
},
94+
slIE9: {
95+
base: 'SauceLabs',
96+
browserName: 'internet explorer',
97+
platform: 'Windows 7',
98+
version: '9'
7099
}
71-
//slIE9: {
72-
// base: 'SauceLabs',
73-
// browserName: 'internet explorer',
74-
// platform: 'Windows 7',
75-
// version: '9'
76-
//},
100+
// Commented out due to lack of polyfills for SourceMapConsumer
77101
//slIE8: {
78102
// base: 'SauceLabs',
79103
// browserName: 'internet explorer',
80104
// platform: 'Windows XP',
81105
// version: '8'
82-
//}
106+
//},
83107
//slIE7: {
84108
// base: 'SauceLabs',
85109
// browserName: 'internet explorer',
86110
// platform: 'Windows XP',
87111
// version: '7'
88112
//}
89-
//slIE6: {
90-
// base: 'SauceLabs',
91-
// browserName: 'internet explorer',
92-
// platform: 'Windows XP',
93-
// version: '6'
94-
//}
95113
};
96114

97115
config.set({
98116
basePath: '',
99-
frameworks: ['jasmine', 'sinon'],
117+
frameworks: ['jasmine-ajax', 'jasmine'],
100118
files: [
101119
'node_modules/es6-promise/dist/es6-promise.js',
102120
'polyfills.js',

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function (config) {
22
config.set({
33
basePath: '',
4-
frameworks: ['jasmine', 'sinon'],
4+
frameworks: ['jasmine-ajax', 'jasmine'],
55
files: [
66
'node_modules/es6-promise/dist/es6-promise.js',
77
'node_modules/stacktrace-gps/dist/stacktrace-gps.min.js',

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@
3232
"gulp": "^3.9.0",
3333
"gulp-concat": "^2.6.0",
3434
"gulp-coveralls": "^0.1.4",
35-
"gulp-jshint": "^1.11.2",
35+
"gulp-jshint": "^1.12.0",
3636
"gulp-sourcemaps": "^1.5.2",
37-
"gulp-uglify": "^1.4.1",
38-
"jasmine-node": "~1.14",
39-
"jasmine-sinon": "^0.4.0",
37+
"gulp-uglify": "^1.5.1",
38+
"jasmine": "^2.3.2",
39+
"jasmine-ajax": "^3.2.0",
40+
"jasmine-core": "^2.3.4",
4041
"json3": "^3.3.2",
4142
"karma": "^0.13.9",
42-
"karma-chrome-launcher": "^0.2.0",
43+
"karma-chrome-launcher": "^0.2.1",
4344
"karma-coverage": "^0.5.2",
44-
"karma-firefox-launcher": "^0.1.6",
45+
"karma-firefox-launcher": "^0.1.7",
4546
"karma-ie-launcher": "^0.2.0",
46-
"karma-jasmine": "^0.1.5",
47+
"karma-jasmine": "^0.3.6",
48+
"karma-jasmine-ajax": "^0.1.13",
4749
"karma-opera-launcher": "^0.3.0",
4850
"karma-phantomjs2-launcher": "^0.3.2",
4951
"karma-safari-launcher": "^0.1.1",
5052
"karma-sauce-launcher": "^0.2.14",
51-
"karma-sinon": "^1.0.4",
52-
"run-sequence": "^1.1.2",
53-
"sinon": "^1.16.1"
53+
"run-sequence": "^1.1.2"
5454
},
5555
"bugs": {
5656
"url": "https://github.com/stacktracejs/stacktrace.js/issues"

polyfills.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Polyfill for old browsers
2+
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
3+
if (!Array.isArray) {
4+
Array.isArray = function(arg) {
5+
return Object.prototype.toString.call(arg) === '[object Array]';
6+
};
7+
}
8+
19
if (typeof Promise === 'undefined') {
210
ES6Promise.polyfill();
311
}

spec/spec-helper.js

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
// Polyfill for old browsers
2-
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
3-
if (!Array.isArray) {
4-
Array.isArray = function(arg) {
5-
return Object.prototype.toString.call(arg) === '[object Array]';
6-
};
7-
}
8-
91
beforeEach(function() {
10-
this.addMatchers({
11-
toMatchStackFrame: function(expected) {
12-
var actual = this.actual;
13-
var message = '';
14-
if (actual.getFunctionName() !== expected[0]) {
15-
message += 'expected functionName: ' + actual.getFunctionName() + ' to equal ' + expected[0] + '\n';
16-
}
17-
if (Array.isArray(actual.getArgs()) && Array.isArray(expected[1])) {
18-
if (actual.getArgs().join() !== expected[1].join()) {
19-
message += 'expected args: ' + actual.getArgs() + ' to equal ' + expected[1] + '\n';
2+
jasmine.addMatchers({
3+
toMatchStackFrame: function() {
4+
return {
5+
compare: function(actual, expected) {
6+
var message = '';
7+
if (actual.getFunctionName() !== expected[0]) {
8+
message += 'expected functionName: ' + actual.getFunctionName() + ' to equal ' + expected[0] + '\n';
9+
}
10+
if (Array.isArray(actual.getArgs()) && Array.isArray(expected[1])) {
11+
if (actual.getArgs().join() !== expected[1].join()) {
12+
message += 'expected args: ' + actual.getArgs() + ' to equal ' + expected[1] + '\n';
13+
}
14+
} else if (actual.getArgs() !== expected[1]) {
15+
message += 'expected args: ' + actual.getArgs() + ' to equal ' + expected[1] + '\n';
16+
}
17+
if (actual.getFileName() !== expected[2]) {
18+
message += 'expected fileName: ' + actual.getFileName() + ' to equal ' + expected[2] + '\n';
19+
}
20+
if (actual.getLineNumber() !== expected[3]) {
21+
message += 'expected lineNumber: ' + actual.getLineNumber() + ' to equal ' + expected[3] + '\n';
22+
}
23+
if (actual.getColumnNumber() !== expected[4]) {
24+
message += 'expected columnNumber: ' + actual.getColumnNumber() + ' to equal ' + expected[4] + '\n';
25+
}
26+
return {pass: message === '', message: message};
2027
}
21-
} else if (actual.getArgs() !== expected[1]) {
22-
message += 'expected args: ' + actual.getArgs() + ' to equal ' + expected[1] + '\n';
23-
}
24-
if (actual.getFileName() !== expected[2]) {
25-
message += 'expected fileName: ' + actual.getFileName() + ' to equal ' + expected[2] + '\n';
26-
}
27-
if (actual.getLineNumber() !== expected[3]) {
28-
message += 'expected lineNumber: ' + actual.getLineNumber() + ' to equal ' + expected[3] + '\n';
29-
}
30-
if (actual.getColumnNumber() !== expected[4]) {
31-
message += 'expected columnNumber: ' + actual.getColumnNumber() + ' to equal ' + expected[4] + '\n';
32-
}
33-
this.message = function() { return message };
34-
return message === '';
28+
};
3529
}
3630
});
3731
});

0 commit comments

Comments
 (0)