1 | // Karma configuration
|
2 | // Generated on Thu Mar 08 2018 08:47:32 GMT+0100 (CET)
|
3 |
|
4 | const rollupConfig = require('./rollup.config');
|
5 | const buble = require('rollup-plugin-buble');
|
6 | const resolve = require("rollup-plugin-node-resolve")
|
7 | const commonjs = require("rollup-plugin-commonjs")
|
8 | const json = require("rollup-plugin-json")
|
9 |
|
10 | delete rollupConfig.input;
|
11 | delete rollupConfig.output.file;
|
12 |
|
13 | rollupConfig.plugins = [
|
14 | json(),
|
15 | resolve({
|
16 | module: true, // Default: true
|
17 | jsnext: true, // Default: false
|
18 | main: true, // Default: true
|
19 | browser: true, // Default: false
|
20 | extensions: ['.js', '.json'], // Default: ['.js']
|
21 | preferBuiltins: true, // Default: true
|
22 | modulesOnly: false, // Default: false
|
23 | customResolveOptions: {}
|
24 | }),
|
25 | commonjs(), // converts date-fns to ES modules
|
26 | buble(),
|
27 | ];
|
28 |
|
29 |
|
30 | module.exports = function (config) {
|
31 | config.set({
|
32 |
|
33 | // base path that will be used to resolve all patterns (eg. files, exclude)
|
34 | basePath: '',
|
35 |
|
36 |
|
37 | // frameworks to use
|
38 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
39 | frameworks: ['jasmine'],
|
40 |
|
41 |
|
42 | // list of files / patterns to load in the browser
|
43 | files: [
|
44 | 'tests/*.js'
|
45 | ],
|
46 |
|
47 |
|
48 | // list of files / patterns to exclude
|
49 | exclude: [],
|
50 |
|
51 |
|
52 | // preprocess matching files before serving them to the browser
|
53 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
54 | preprocessors: {
|
55 | 'tests/*.js': ['rollup']
|
56 | },
|
57 |
|
58 | // rollup settings. See Rollup documentation
|
59 | rollupPreprocessor: rollupConfig,
|
60 |
|
61 | // tests results reporter to use
|
62 | // possible values: 'dots', 'progress'
|
63 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
64 | reporters: ['progress'],
|
65 |
|
66 |
|
67 | // web server port
|
68 | port: 9876,
|
69 |
|
70 |
|
71 | // enable / disable colors in the output (reporters and logs)
|
72 | colors: true,
|
73 |
|
74 |
|
75 | // level of logging
|
76 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
77 | logLevel: config.LOG_INFO,
|
78 |
|
79 |
|
80 | // enable / disable watching file and executing tests whenever any file changes
|
81 | autoWatch: false,
|
82 |
|
83 |
|
84 | // start these browsers
|
85 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
86 | browsers: ['Chrome'],
|
87 |
|
88 |
|
89 | // Continuous Integration mode
|
90 | // if true, Karma captures browsers, runs the tests and exits
|
91 | singleRun: false,
|
92 |
|
93 | // Concurrency level
|
94 | // how many browser should be started simultaneous
|
95 | concurrency: Infinity
|
96 |
|
97 |
|
98 | })
|
99 | }
|