Skip to content

Commit

Permalink
Fix: karma-mocha should run both browser bundles (#4663)
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba authored Jun 23, 2021
1 parent a068f1c commit f033ff1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
const env = process.env;
const hostname = os.hostname();

if (fs.existsSync('./mocha.js') && fs.existsSync('./mocha-es5.js')) {
fs.renameSync('./mocha.js', './mocha-es2018.js');
fs.renameSync('./mocha-es5.js', './mocha.js');
}

const SAUCE_BROWSER_PLATFORM_MAP = {
'chrome@latest': 'Windows 10',
'MicrosoftEdge@latest': 'Windows 10',
Expand Down
5 changes: 5 additions & 0 deletions karma_no-ie11.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
const env = process.env;
const hostname = os.hostname();

if (fs.existsSync('./mocha.js') && fs.existsSync('./mocha-es2018.js')) {
fs.renameSync('./mocha.js', './mocha-es5.js');
fs.renameSync('./mocha-es2018.js', './mocha.js');
}

const SAUCE_BROWSER_PLATFORM_MAP = {
'chrome@latest': 'Windows 10',
'MicrosoftEdge@latest': 'Windows 10',
Expand Down
2 changes: 1 addition & 1 deletion package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ module.exports = {
},
unit: {
script:
'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',
'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',
description: 'Run browser unit tests'
},
bdd: {
Expand Down

0 comments on commit f033ff1

Please sign in to comment.