|
1 | 1 | // jshint strict: false |
| 2 | +const webpackConfig = require('./webpack.config'); |
| 3 | +delete webpackConfig.entry; |
| 4 | +delete webpackConfig.output; |
2 | 5 |
|
3 | 6 | module.exports = function (config) { |
4 | 7 | config.set({ |
5 | 8 | basePath: '', |
6 | 9 |
|
7 | | - frameworks: ['jasmine-jquery', 'jasmine'], |
| 10 | + frameworks: ['jquery-2.0.0', 'jasmine'], |
8 | 11 |
|
9 | 12 | files: [ |
10 | 13 | './test/unit/setup.js', |
11 | | - // {pattern: './src/scripts/**/*.js', included: false}, |
12 | 14 | {pattern: './test/unit/fixtures/**/*.html', included: false, served: true}, |
13 | | - // {pattern: './test/helpers/**/*.js', included: false}, |
14 | | - './test/unit/**/*.spec.js' |
| 15 | + 'test/unit/**/*.spec.js' |
15 | 16 | ], |
16 | 17 |
|
17 | 18 | preprocessors: { |
18 | | - './test/unit/setup.js': ['rollup'], |
19 | | - './src/scripts/**/*.js': ['rollup', /*'sourcemap', 'coverage'*/], |
20 | | - './test/unit/**/*.spec.js': ['rollup', /*'sourcemap'*/] |
| 19 | + './test/unit/setup.js': ['webpack'], |
| 20 | + './src/scripts/**/*.js': ['webpack'], |
| 21 | + 'test/unit/**/*.spec.js': ['webpack'] |
21 | 22 | }, |
22 | 23 |
|
23 | | - rollupPreprocessor: { |
24 | | - plugins: [ |
25 | | - require('rollup-plugin-node-resolve')({ |
26 | | - jsnext: true, |
27 | | - main: true, |
28 | | - browser: true |
29 | | - }), |
30 | | - require('rollup-plugin-sass')({ |
31 | | - output: false, |
32 | | - processor(css) { |
33 | | - return require('postcss')([require('autoprefixer')]).process(css) |
34 | | - .then(result => result.css); |
35 | | - } |
| 24 | + webpack: Object.assign({}, webpackConfig, { |
| 25 | + output: { |
36 | 26 |
|
37 | | - }), |
38 | | - require('rollup-plugin-handlebars-plus')({ |
39 | | - templateExtension: '.html' |
40 | | - }), |
41 | | - require('rollup-plugin-commonjs')(), |
42 | | - require('rollup-plugin-istanbul')({ |
43 | | - exclude: ['./test/unit/**/*.js', 'node_modules/**'] |
44 | | - }), |
45 | | - require('rollup-plugin-babel')({ |
46 | | - exclude: 'node_modules/**' |
47 | | - }) |
48 | | - ], |
49 | | - format: 'iife', |
50 | | - moduleName: 'typester', |
51 | | - sourceMap: 'inline' |
| 27 | + } |
| 28 | + }), |
| 29 | + |
| 30 | + webpackMiddleware: { |
| 31 | + noInfo: true |
52 | 32 | }, |
| 33 | + |
53 | 34 | logLevel: config.LOG_DEBUG, |
54 | | - plugins: [ |
55 | | - 'karma-rollup-preprocessor', |
56 | | - 'karma-jasmine', |
57 | | - 'karma-jasmine-jquery', |
58 | | - 'karma-spec-reporter', |
59 | | - 'karma-sourcemap-loader', |
60 | | - 'karma-coverage', |
61 | | - 'karma-phantomjs-launcher' |
62 | | - ], |
63 | | - reporters: ['spec'/*, 'coverage' */], |
| 35 | + reporters: ['spec'], |
64 | 36 | coverageReporter: { |
65 | 37 | type: 'html', |
66 | 38 | dir: 'coverage/' |
67 | 39 | }, |
68 | 40 | browsers: ['PhantomJS'], |
69 | 41 | autoWatchBatchDelay: 3000 |
70 | 42 | }); |
71 | | - |
72 | | - |
73 | | - if (process.env.NODE_ENV === 'ci') { |
74 | | - config.set({ |
75 | | - plugins: config.plugins.concat([ |
76 | | - 'karma-junit-reporter', |
77 | | - 'karma-chrome-launcher', |
78 | | - 'karma-firefox-launcher' |
79 | | - ]), |
80 | | - reporters: ['junit'], |
81 | | - autoWatch: false, |
82 | | - browserDisconnectTolerance: 2, |
83 | | - concurrency: 1, |
84 | | - singleRun: true, |
85 | | - junitReporter: { |
86 | | - outputDir: 'coverage', |
87 | | - outputFile: 'report.xml', |
88 | | - suite: '', |
89 | | - useBrowserName: true |
90 | | - }, |
91 | | - customLaunchers: { |
92 | | - 'chrome': { |
93 | | - base: 'Chrome', |
94 | | - flags: ['--headless', '--no-sandbox', '--disable-gpu', '--remote-debugging-port=9222'], |
95 | | - displayName: 'Typester-Chrome' |
96 | | - }, |
97 | | - 'firefox': { |
98 | | - base: 'Firefox', |
99 | | - flags: ['-headless'], |
100 | | - displayName: 'Typester-Firefox' |
101 | | - }, |
102 | | - 'phantom': { |
103 | | - base: 'PhantomJS', |
104 | | - displayName: 'Typester-PhantomJS' |
105 | | - } |
106 | | - }, |
107 | | - browsers: ['phantom', 'chrome', 'firefox'] |
108 | | - }); |
109 | | - } |
110 | 43 | }; |
0 commit comments