some frontend unit tests

This commit is contained in:
Danny Coates 2018-02-20 20:31:27 -08:00
parent 4929437283
commit 78728ce4ca
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
24 changed files with 708 additions and 417 deletions

View file

@ -11,12 +11,19 @@ const regularJSOptions = {
plugins: ['yo-yoify']
};
const entry = {
vendor: ['babel-polyfill', 'fluent'],
app: ['./app/main.js'],
style: ['./app/main.css']
};
if (IS_DEV) {
entry.tests = ['./test/frontend/index.js'];
regularJSOptions.plugins.push('istanbul');
}
module.exports = {
entry: {
vendor: ['babel-polyfill', 'fluent'],
app: ['./app/main.js'],
style: ['./app/main.css']
},
entry,
output: {
filename: '[name].[chunkhash:8].js',
path: path.resolve(__dirname, 'dist'),
@ -126,6 +133,10 @@ module.exports = {
'./build/fluent_loader'
]
},
{
test: require.resolve('./test/frontend/index.js'),
use: ['babel-loader', 'val-loader']
},
{
test: require.resolve('./build/generate_asset_map.js'),
use: ['babel-loader', 'val-loader']