UNPKG

1.16 kBJavaScriptView Raw
1const path = require('path');
2const glob = require('glob');
3const _ = require('lodash');
4process.env.IS_SUMAN_BROWSER_TEST='yes';
5
6const all = _.flattenDeep([process.env.SUMAN_BROWSER_TEST_PATHS || glob.sync('./test/src/dev/browser/**/*.ts')]);
7const entries = all.filter(f => f);
8
9if(!entries.length){
10 throw new Error('no test files could be found given your webpack configuration.');
11}
12
13
14module.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 // ignore both .ts and .d.ts files
32 test: /\.ts$/,
33 loader: 'ts-loader'
34 },
35 {
36 // ignore both .ts and .d.ts files
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};