Merge pull request #12987 from tschaub/karma-update

Browser test config update
This commit is contained in:
Tim Schaub
2021-11-12 06:41:29 -07:00
committed by GitHub
4 changed files with 101 additions and 1275 deletions
+86 -1244
View File
File diff suppressed because it is too large Load Diff
+4 -7
View File
@@ -65,8 +65,6 @@
"chaikin-smooth": "^1.0.4", "chaikin-smooth": "^1.0.4",
"clean-css-cli": "5.4.2", "clean-css-cli": "5.4.2",
"copy-webpack-plugin": "^9.0.0", "copy-webpack-plugin": "^9.0.0",
"coverage-istanbul-loader": "^3.0.5",
"coveralls": "3.1.1",
"es-main": "^1.0.2", "es-main": "^1.0.2",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-config-openlayers": "^16.0.1", "eslint-config-openlayers": "^16.0.1",
@@ -82,12 +80,11 @@
"jsdoc": "3.6.7", "jsdoc": "3.6.7",
"jsdoc-plugin-typescript": "^2.0.5", "jsdoc-plugin-typescript": "^2.0.5",
"json-stringify-safe": "^5.0.1", "json-stringify-safe": "^5.0.1",
"karma": "^6.3.2", "karma": "^6.3.8",
"karma-chrome-launcher": "3.1.0", "karma-chrome-launcher": "^3.1.0",
"karma-coverage-istanbul-reporter": "^3.0.0", "karma-firefox-launcher": "^2.1.2",
"karma-firefox-launcher": "^2.0.0",
"karma-mocha": "2.0.1", "karma-mocha": "2.0.1",
"karma-sourcemap-loader": "^0.3.8", "karma-source-map-support": "^1.4.0",
"karma-webpack": "^5.0.0", "karma-webpack": "^5.0.0",
"loglevelnext": "^5.0.5", "loglevelnext": "^5.0.5",
"marked": "4.0.0", "marked": "4.0.0",
+7 -4
View File
@@ -15,7 +15,7 @@ Run the tests once:
npm test npm test
This will run tests in Chrome. If you do not have Chrome installed, you can run tests on Firefox instead: This will run tests in (headless) Chrome. If you do not have Chrome installed, you can run tests on Firefox instead:
npm test -- --browsers Firefox npm test -- --browsers Firefox
@@ -25,9 +25,12 @@ To run the tests continuously:
npm run karma npm run karma
After this, the test server is listening on http://localhost:9876/, and you can After this, you can attach any browser and debug the tests like this:
attach any number of browsers for testing (during development, tests will run
in Chrome by default). * open http://localhost:9876/debug.html
* open the developer tools
* add a breakpoint
* refresh the page
# Rendering tests # Rendering tests
+4 -20
View File
@@ -4,9 +4,9 @@ const path = require('path');
module.exports = function (karma) { module.exports = function (karma) {
karma.set({ karma.set({
browsers: [process.env.CI ? 'ChromeHeadless' : 'Chrome'], browsers: ['ChromeHeadless'],
browserDisconnectTolerance: 2, browserDisconnectTolerance: 2,
frameworks: ['webpack', 'mocha'], frameworks: ['webpack', 'mocha', 'source-map-support'],
client: { client: {
runInParent: true, runInParent: true,
mocha: { mocha: {
@@ -63,14 +63,9 @@ module.exports = function (karma) {
'/spec/': '/base/spec/', '/spec/': '/base/spec/',
}, },
preprocessors: { preprocessors: {
'**/*.js': ['webpack', 'sourcemap'], '**/*.js': ['webpack'], //, 'sourcemap'],
},
reporters: ['dots', 'coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['text-summary', 'html'],
dir: path.resolve(__dirname, '../../coverage/'),
fixWebpackSourcePaths: true,
}, },
reporters: ['dots'],
webpack: { webpack: {
devtool: 'inline-source-map', devtool: 'inline-source-map',
mode: 'development', mode: 'development',
@@ -97,17 +92,6 @@ module.exports = function (karma) {
include: path.resolve('src/ol/'), include: path.resolve('src/ol/'),
exclude: path.resolve('node_modules/'), exclude: path.resolve('node_modules/'),
}, },
{
test: /\.js$/,
use: {
loader: 'coverage-istanbul-loader',
options: {
esModules: true,
},
},
include: path.resolve('src/ol/'),
exclude: path.resolve('node_modules/'),
},
{ {
test: /\.js$/, test: /\.js$/,
use: { use: {