Skip to content

Commit f033ff1

Browse files
authored
Fix: karma-mocha should run both browser bundles (#4663)
1 parent a068f1c commit f033ff1

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

karma.conf.js

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
2929
const env = process.env;
3030
const hostname = os.hostname();
3131

32+
if (fs.existsSync('./mocha.js') && fs.existsSync('./mocha-es5.js')) {
33+
fs.renameSync('./mocha.js', './mocha-es2018.js');
34+
fs.renameSync('./mocha-es5.js', './mocha.js');
35+
}
36+
3237
const SAUCE_BROWSER_PLATFORM_MAP = {
3338
'chrome@latest': 'Windows 10',
3439
'MicrosoftEdge@latest': 'Windows 10',

karma_no-ie11.conf.js

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
1818
const env = process.env;
1919
const hostname = os.hostname();
2020

21+
if (fs.existsSync('./mocha.js') && fs.existsSync('./mocha-es2018.js')) {
22+
fs.renameSync('./mocha.js', './mocha-es5.js');
23+
fs.renameSync('./mocha-es2018.js', './mocha.js');
24+
}
25+
2126
const SAUCE_BROWSER_PLATFORM_MAP = {
2227
'chrome@latest': 'Windows 10',
2328
'MicrosoftEdge@latest': 'Windows 10',

package-scripts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ module.exports = {
211211
},
212212
unit: {
213213
script:
214-
'cross-env NODE_PATH=. karma start karma.conf.js --single-run --colors && cross-env NODE_PATH=. karma start karma_no-ie11.conf.js --single-run --colors',
214+
'cross-env NODE_PATH=. karma start karma_no-ie11.conf.js --single-run --colors && cross-env NODE_PATH=. karma start karma.conf.js --single-run --colors',
215215
description: 'Run browser unit tests'
216216
},
217217
bdd: {

0 commit comments

Comments
 (0)