Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bcheidemann committed Mar 21, 2021
1 parent eaf0c90 commit 71c0e0f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions tests/setup-mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ var mocha = require('mocha');
mocha.setup('bdd').timeout(10000).slow(250);

window.onload = function() {
mocha.checkLeaks();
mocha.run();
mocha.checkLeaks();
mocha.run();
};
104 changes: 52 additions & 52 deletions tests/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');

module.exports = env => ({
mode: 'development',
entry: path.resolve(__dirname, './webpack-tests.js'),
resolve: {
alias: {
'fsProvider': path.resolve(__dirname, '../shims/providers/default'),
},
mode: 'development',
entry: path.resolve(__dirname, './webpack-tests.js'),
resolve: {
alias: {
'fsProvider': path.resolve(__dirname, '../shims/providers/default'),
},
output: {
path: path.resolve(__dirname, './dist-webpack'),
filename: 'index.js',
},
plugins: [
new webpack.ContextReplacementPlugin(
// Mocha safely uses require in such a way that webpack cannot statically extract dependancies.
// If the ignoreRequestDependancyExpressionWarnings env is set, we will aggregate these warnings
// into one summary warning to minimise spamming the console.
/\/node_modules\/mocha\/lib/,
(data) => {
if (env.ignoreRequestDependancyExpressionWarnings) {
let requestDependencyExpressionsIgnored = 0;
data.dependencies.forEach((dependancy) => {
if (dependancy.critical === 'the request of a dependency is an expression') {
dependancy.critical = undefined;
requestDependencyExpressionsIgnored += 1;
}
});
console.log(`WARNING: Ignoring ${requestDependencyExpressionsIgnored} "request of a dependency is an expression" warnings from "node_modules/mocha/lib".`);
}
return data;
},
),
new NodePolyfillPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
title: 'Filer Tests - Webpack Build',
template: './tests/webpack.index.html',
}),
},
output: {
path: path.resolve(__dirname, './dist-webpack'),
filename: 'index.js',
},
plugins: [
new webpack.ContextReplacementPlugin(
// Mocha safely uses require in such a way that webpack cannot statically extract dependancies.
// If the ignoreRequestDependancyExpressionWarnings env is set, we will aggregate these warnings
// into one summary warning to minimise spamming the console.
/\/node_modules\/mocha\/lib/,
(data) => {
if (env.ignoreRequestDependancyExpressionWarnings) {
let requestDependencyExpressionsIgnored = 0;
data.dependencies.forEach((dependancy) => {
if (dependancy.critical === 'the request of a dependency is an expression') {
dependancy.critical = undefined;
requestDependencyExpressionsIgnored += 1;
}
});
console.log(`WARNING: Ignoring ${requestDependencyExpressionsIgnored} "request of a dependency is an expression" warnings from "node_modules/mocha/lib".`);
}
return data;
},
),
new NodePolyfillPlugin(),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
title: 'Filer Tests - Webpack Build',
template: './tests/webpack.index.html',
}),
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
optimization: {
minimize: false,
},
devtool: 'inline-source-map',
devServer: {
contentBase: path.resolve(__dirname, './dist-webpack'),
}
},
optimization: {
minimize: false,
},
devtool: 'inline-source-map',
devServer: {
contentBase: path.resolve(__dirname, './dist-webpack'),
}
});

0 comments on commit 71c0e0f

Please sign in to comment.