Uses custom webpack config for testing

This commit is contained in:
Aaron Louie 2020-01-27 11:07:40 -05:00
parent 46f1d3b095
commit fbffb70172
2 changed files with 7 additions and 3 deletions

View File

@ -105,8 +105,11 @@
} }
}, },
"test": { "test": {
"builder": "@angular-devkit/build-angular:karma", "builder": "@angular-builders/custom-webpack:karma",
"options": { "options": {
"customWebpackConfig": {
"path": "./webpack.config.js"
},
"main": "src/test.ts", "main": "src/test.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json", "tsConfig": "src/tsconfig.spec.json",

View File

@ -1,4 +1,5 @@
const WebpackNotifierPlugin = require('webpack-notifier'); const WebpackNotifierPlugin = require('webpack-notifier');
const webpack = require('webpack');
const path = require('path'); const path = require('path');
module.exports = { module.exports = {
@ -19,7 +20,7 @@ module.exports = {
exclude: /node_modules\/(?!(dmn-js|dmn-js-drd|dmn-js-shared|dmn-js-decision-table|table-js|dmn-js-literal-expression|diagram-js)\/).*/, exclude: /node_modules\/(?!(dmn-js|dmn-js-drd|dmn-js-shared|dmn-js-decision-table|table-js|dmn-js-literal-expression|diagram-js)\/).*/,
loader: 'babel-loader', loader: 'babel-loader',
options: { options: {
presets: ["@babel/preset-react", '@babel/preset-env'] presets: ['@babel/preset-react', '@babel/preset-env']
} }
} }
] ]
@ -29,6 +30,6 @@ module.exports = {
alwaysNotify: true, alwaysNotify: true,
title: 'App Name', title: 'App Name',
contentImage: path.join(__dirname, 'image.png') contentImage: path.join(__dirname, 'image.png')
}), })
] ]
}; };