Skip to content

Commit

Permalink
test(karma): Update karma and fix test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Aug 18, 2021
1 parent fecce6e commit 43925e2
Show file tree
Hide file tree
Showing 3 changed files with 2,914 additions and 4,585 deletions.
29 changes: 21 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/* eslint-disable global-require */
/* eslint-disable react/require-extension */
var path = require('path');
var loaders = require('./config/webpack.loaders.js');
const path = require('path');
const webpack = require('webpack');

const pvwRules = require('./config/wp5/rules-pvw.js');
const vtkRules = require('./config/wp5/rules-vtk.js');
const wslinkRules = require('./config/wp5/rules-wslink.js');

const sourcePath = path.join(__dirname, './src');

var styles = path.join(__dirname, './style');

Expand All @@ -15,7 +21,7 @@ module.exports = function karmaConf(config) {
require('karma-tap-pretty-reporter'),
],
basePath: '',
frameworks: ['tap'],
frameworks: ['tap', 'webpack'],
files: [
'./src/**/tests/*.js',
{ pattern: 'data/**', watched: false, included: false, served: true },
Expand All @@ -40,18 +46,25 @@ module.exports = function karmaConf(config) {

webpack: {
mode: 'development',
node: {
fs: 'empty',
},
module: {
rules: [].concat(loaders),
rules: [].concat(pvwRules, vtkRules, wslinkRules),
},
resolve: {
modules: [path.resolve(__dirname, 'node_modules'), sourcePath],
alias: {
paraviewweb: __dirname,
PVWStyle: styles,
stream: 'stream-browserify',
buffer: 'buffer',
},
fallback: {
path: false,
fs: false,
},
},
plugins: [
new webpack.ProvidePlugin({ process: ['process/browser'] }),
],
},

webpackMiddleware: {
Expand Down Expand Up @@ -79,7 +92,7 @@ module.exports = function karmaConf(config) {
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
flags: ['--no-sandbox', '--ignore-gpu-blacklist'],
},
},

Expand Down
Loading

0 comments on commit 43925e2

Please sign in to comment.