forked from okta/okta-signin-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.test.config.js
35 lines (29 loc) · 1.11 KB
/
webpack.test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var path = require('path');
var commonConfig = require('./webpack.common.config');
var createPlugins = require('./scripts/buildtools/webpack/plugins');
var useRuntime = require('./scripts/buildtools/webpack/runtime');
var testConfig = commonConfig('main-tests.js');
var rootDir = path.resolve(__dirname);
var RemoveStrictPlugin = require( 'remove-strict-webpack-plugin' );
var plugins = createPlugins({ isProduction: false });
var webpack = require('webpack');
var SDK_VERSION = require('@okta/okta-auth-js').SDK_VERSION; // Maintain CommonJS require for Node.js
plugins.unshift(new RemoveStrictPlugin());
plugins.push(new webpack.DefinePlugin({
SDK_VERSION: JSON.stringify(SDK_VERSION)
}));
testConfig.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
});
testConfig.entry = null;
testConfig.output = null;
testConfig.devtool = 'inline-source-map';
testConfig.plugins = plugins;
Object.assign(testConfig.resolve.alias, {
'sandbox': `${rootDir}/test/unit/helpers/sandbox`,
'helpers': `${rootDir}/test/unit/helpers`
});
useRuntime(testConfig);
module.exports = testConfig;