Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 'karma-mocha' should run both browser bundles #4663

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: karma-mocha should run both browser bundles
  • Loading branch information
juergba committed Jun 20, 2021
commit 10b0a0fbe8add09998c974777150f8c0584751d9
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