1 | const path = require('path');
|
2 | const glob = require('glob');
|
3 | const _ = require('lodash');
|
4 | process.env.IS_SUMAN_BROWSER_TEST='yes';
|
5 |
|
6 | const all = _.flattenDeep([process.env.SUMAN_BROWSER_TEST_PATHS || glob.sync('./test/src/dev/browser/**/*.ts')]);
|
7 | const entries = all.filter(f => f);
|
8 |
|
9 | if(!entries.length){
|
10 | throw new Error('no test files could be found given your webpack configuration.');
|
11 | }
|
12 |
|
13 |
|
14 | module.exports = {
|
15 |
|
16 | entry: entries,
|
17 |
|
18 | output: {
|
19 | path: path.resolve(__dirname + '/test/.suman/browser/builds'),
|
20 | filename: 'browser-tests.js'
|
21 | },
|
22 |
|
23 | module: {
|
24 |
|
25 | rules: [
|
26 | {
|
27 | test: /babel-polyfill/,
|
28 | loader: 'ignore-loader'
|
29 | },
|
30 | {
|
31 |
|
32 | test: /\.ts$/,
|
33 | loader: 'ts-loader'
|
34 | },
|
35 | {
|
36 |
|
37 | test: /\.d\.ts$/,
|
38 | loader: 'ignore-loader'
|
39 | },
|
40 | {
|
41 | test: new RegExp('^' + path.resolve(__dirname + '/lib/cli-commands/') + '.*'),
|
42 | loader: 'ignore-loader'
|
43 | },
|
44 | {
|
45 | test: new RegExp('^' + path.resolve(__dirname + '/suman.conf.js')),
|
46 | loader: 'ignore-loader'
|
47 | }
|
48 | ]
|
49 | }
|
50 |
|
51 | };
|