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