Skip to content

Commit ff5ba8a

Browse files
committed
updated karma tests
updated karma tests to echo https://github.com/Leaflet/Leaflet/blob/main/spec/karma.conf.js and also removed travis references
1 parent e1ae96d commit ff5ba8a

File tree

5 files changed

+411
-129
lines changed

5 files changed

+411
-129
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ site/build
4040
# Built Files
4141
dist
4242

43-
# so semistandard doesnt lint the folder during CI
44-
travis_phantomjs

.travis.yml

-15
This file was deleted.

karma.conf.js

+40-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// Karma configuration
2-
// Generated on Fri May 30 2014 15:44:45 GMT-0400 (EDT)
3-
42
module.exports = function (config) {
53
var configuration = {
64

@@ -39,37 +37,64 @@ module.exports = function (config) {
3937
// web server port
4038
port: 9876,
4139

42-
// enable / disable colors in the output (reporters and logs)
43-
colors: true,
44-
4540
// level of logging
4641
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
4742
logLevel: config.LOG_WARN,
4843

44+
// enable / disable colors in the output (reporters and logs)
45+
colors: true,
46+
4947
// enable / disable watching file and executing tests whenever any file changes
50-
autoWatch: true,
48+
autoWatch: false,
5149

5250
// start these browsers
5351
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
54-
browsers: [
55-
'Chrome'
56-
// 'ChromeCanary',
57-
// 'Firefox',
58-
// 'Safari',
59-
// 'PhantomJS'
60-
],
52+
browsers: ['Chrome1280x1024'],
6153

6254
customLaunchers: {
63-
Chrome_travis_ci: {
55+
Chrome1280x1024: {
6456
base: 'ChromeHeadless',
65-
flags: ['--no-sandbox']
57+
// increased viewport is required for some tests (TODO fix tests)
58+
// https://github.com/Leaflet/Leaflet/issues/7113#issuecomment-619528577
59+
flags: ['--window-size=1280,1024']
60+
},
61+
FirefoxTouch: {
62+
base: 'FirefoxHeadless',
63+
prefs: {
64+
'dom.w3c_touch_events.enabled': 1
65+
}
66+
},
67+
FirefoxNoTouch: {
68+
base: 'FirefoxHeadless',
69+
prefs: {
70+
'dom.w3c_touch_events.enabled': 0
71+
}
72+
},
73+
IE10: {
74+
base: 'IE',
75+
'x-ua-compatible': 'IE=EmulateIE10'
6676
}
6777
},
6878

79+
concurrency: 1,
80+
81+
// If browser does not capture in given timeout [ms], kill it
82+
captureTimeout: 60000,
83+
84+
// Timeout for the client socket connection [ms].
85+
browserSocketTimeout: 30000,
86+
6987
// Continuous Integration mode
7088
// if true, Karma captures browsers, runs the tests and exits
7189
singleRun: true,
7290

91+
client: {
92+
mocha: {
93+
// eslint-disable-next-line no-undef
94+
forbidOnly: process.env.CI || false
95+
}
96+
},
97+
7398
// Configure the coverage reporters
7499
coverageReporter: {
75100
reporters: [
@@ -83,9 +108,5 @@ module.exports = function (config) {
83108
}
84109
};
85110

86-
if (process.env.TRAVIS) {
87-
configuration.browsers = ['Chrome_travis_ci'];
88-
}
89-
90111
config.set(configuration);
91112
};

0 commit comments

Comments
 (0)