Skip to content

Commit

Permalink
chore(JGIVEN-3): make html app run tests
Browse files Browse the repository at this point in the history
Signed-off-by: l-1squared <30831153+l-1squared@users.noreply.github.com>
  • Loading branch information
l-1squared committed Oct 2, 2024
1 parent 40ae6f9 commit 5d686e2
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 61 deletions.
50 changes: 10 additions & 40 deletions legacy/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
// Karma configuration
// Generated on Sat Aug 01 2015 13:13:27 GMT+0200 (CEST)
const webpackConfig = require('./webpack.config');

module.exports = function (config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'src/test/*.js'
Expand All @@ -24,21 +20,7 @@ module.exports = function (config) {
'src/test/*.js': ['webpack']
},

webpack: {
module : {
preLoaders: [],
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
}
}
]
}
},
webpack: webpackConfig,

webpackMiddleware: {
// webpack-dev-middleware configuration
Expand All @@ -51,49 +33,37 @@ module.exports = function (config) {
}
},

babelPreprocessor: {
options: {
presets: ['es2015'],
sourceMap: 'inline'
}
},

// list of files to exclude
exclude: [
],

exclude: [],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],

browsers: ['jsdom'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
singleRun: false,

})
}
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};
5 changes: 3 additions & 2 deletions legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"start": "webpack-dev-server --progress --colors --port 8085",
"debug": "webpack-dev-server -d --progress --colors",
"test": "karma start --debug --single-run --browsers PhantomJS",
"test": "karma start --debug --single-run --browsers jsdom",
"test-watch": "karma start --debug",
"build": "mkdir dist && webpack --progress",
"integration-test": "yarn build && rm -rf integration && cp -r dist integration && cp -r data integration",
Expand All @@ -30,12 +30,13 @@
"file-loader": "^6.0.0",
"html-webpack-plugin": "^5.0.0",
"jasmine-core": "^2.3.4",
"jsdom": "^24.0.0",
"karma": "^6.0.0",
"karma-babel-preprocessor": "^6.0.1",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.1.0",
"karma-jsdom-launcher": "^17.0.0",
"karma-mocha-reporter": "^2.2.1",
"karma-phantomjs-launcher": "1.0.2",
"karma-webpack": "^5.0.1",
"mini-css-extract-plugin": "^2.9.1",
"phantomjs-prebuilt": "^2.1.7",
Expand Down
Loading

0 comments on commit 5d686e2

Please sign in to comment.