build(frontend): update karma config

This commit is contained in:
Sarah Vaupel 2024-09-04 03:18:46 +02:00
parent c7d5cbfb49
commit d4d18a968c
5 changed files with 2052 additions and 6 deletions

View File

@ -112,8 +112,8 @@ frontend-%: node_modules well-known --frontend-%;
@echo Hooray! There are no hints.
.PHONY: --frontend-test
--frontend-test: karma.conf.js
npx -- karma start --conf karma.conf.js $(WATCH)
--frontend-test: karma.conf.cjs
npx -- karma start --conf karma.conf.cjs $(WATCH)
.PHONY: --frontend-test-watch
--frontend-test-watch: WATCH=--single-run false

View File

@ -27,4 +27,4 @@ RUN make node_modules
RUN make well-known
ENV FRADRIVE_MAKE_TARGET=frontend-watch
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} CHROME_BIN=${CHROME_BIN}
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} CHROME_BIN=${CHROME_BIN}

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>
// SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>, Sarah Vaupel <vaupel.sarah@campus.lmu.de>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
@ -20,7 +20,7 @@ module.exports = function(config) {
logLevel: config.LOG_WARN, //config.LOG_DISABLE, config.LOG_ERROR, config.LOG_INFO, config.LOG_DEBUG
//list of frameworks you want to use, only jasmine is installed automatically
frameworks: ['jasmine'],
frameworks: ['jasmine', 'browserify'],
//list of browsers to launch and capture
browsers: ['ChromeHeadless'],
//list of reporters to use
@ -56,8 +56,11 @@ module.exports = function(config) {
},
preprocessors: {
//add webpack as preprocessor to support require() in test-suits .js files
'./frontend/src/**/*.js': ['webpack']
'./frontend/src/**/*.js': ['browserify']
},
plugins: [
'karma-browserify'
],
webpackMiddleware: {
//turn off webpack bash output when run the tests
noInfo: true,

2042
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,7 @@
"jasmine-core": "^5.2.0",
"js-yaml": "^4.1.0",
"karma": "^6.4.4",
"karma-browserify": "^8.1.0",
"karma-chrome-launcher": "^3.2.0",
"karma-cli": "^2.0.0",
"karma-jasmine": "^5.1.0",