Test config update

This commit is contained in:
Tim Schaub
2021-11-10 14:33:13 -07:00
parent 924b85f4ca
commit 70dbe21520
4 changed files with 101 additions and 1275 deletions

1330
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -65,8 +65,6 @@
"chaikin-smooth": "^1.0.4",
"clean-css-cli": "5.4.2",
"copy-webpack-plugin": "^9.0.0",
"coverage-istanbul-loader": "^3.0.5",
"coveralls": "3.1.1",
"es-main": "^1.0.2",
"eslint": "^8.0.1",
"eslint-config-openlayers": "^16.0.1",
@@ -82,12 +80,11 @@
"jsdoc": "3.6.7",
"jsdoc-plugin-typescript": "^2.0.5",
"json-stringify-safe": "^5.0.1",
"karma": "^6.3.2",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "^3.0.0",
"karma-firefox-launcher": "^2.0.0",
"karma": "^6.3.8",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.2",
"karma-mocha": "2.0.1",
"karma-sourcemap-loader": "^0.3.8",
"karma-source-map-support": "^1.4.0",
"karma-webpack": "^5.0.0",
"loglevelnext": "^5.0.5",
"marked": "4.0.0",

View File

@@ -15,7 +15,7 @@ Run the tests once:
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
@@ -25,9 +25,12 @@ To run the tests continuously:
npm run karma
After this, the test server is listening on http://localhost:9876/, and you can
attach any number of browsers for testing (during development, tests will run
in Chrome by default).
After this, you can attach any browser and debug the tests like this:
* open http://localhost:9876/debug.html
* open the developer tools
* add a breakpoint
* refresh the page
# Rendering tests

View File

@@ -4,9 +4,9 @@ const path = require('path');
module.exports = function (karma) {
karma.set({
browsers: [process.env.CI ? 'ChromeHeadless' : 'Chrome'],
browsers: ['ChromeHeadless'],
browserDisconnectTolerance: 2,
frameworks: ['webpack', 'mocha'],
frameworks: ['webpack', 'mocha', 'source-map-support'],
client: {
runInParent: true,
mocha: {
@@ -63,14 +63,9 @@ module.exports = function (karma) {
'/spec/': '/base/spec/',
},
preprocessors: {
'**/*.js': ['webpack', 'sourcemap'],
},
reporters: ['dots', 'coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['text-summary', 'html'],
dir: path.resolve(__dirname, '../../coverage/'),
fixWebpackSourcePaths: true,
'**/*.js': ['webpack'], //, 'sourcemap'],
},
reporters: ['dots'],
webpack: {
devtool: 'inline-source-map',
mode: 'development',
@@ -97,17 +92,6 @@ module.exports = function (karma) {
include: path.resolve('src/ol/'),
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$/,
use: {