UNPKG

2.36 kBJavaScriptView Raw
1var json = require('rollup-plugin-json');
2
3// Karma configuration
4module.exports = function (config) {
5
6 // var libSources = require(__dirname + '/../build/build.js').getFiles();
7
8 var files = [
9 "spec/sinon.js",
10 "spec/expect.js",
11
12 "node_modules/leaflet/dist/leaflet-src.js",
13 "src/index.js",
14
15 "spec/after.js",
16 "node_modules/happen/happen.js",
17 "spec/suites/SpecHelper.js",
18 "spec/suites/**/*.js",
19 "dist/*.css"
20 ];
21
22 config.set({
23 // base path, that will be used to resolve files and exclude
24 basePath: '../',
25
26 plugins: [
27 'karma-rollup-plugin',
28 'karma-mocha',
29 'karma-coverage',
30 'karma-phantomjs-launcher',
31 'karma-chrome-launcher',
32 'karma-safari-launcher',
33 'karma-firefox-launcher'
34 ],
35
36 // frameworks to use
37 frameworks: ['mocha'],
38
39 // list of files / patterns to load in the browser
40 files: files,
41// proxies: {
42// '/base/dist/images/': 'dist/images/'
43// },
44 exclude: [],
45
46 // Rollup the ES6 Leaflet.markercluster sources into just one file, before tests
47 preprocessors: {
48 'src/index.js': ['rollup']
49 },
50 rollupPreprocessor: {
51 plugins: [
52 json()
53 ],
54 format: 'umd',
55 moduleName: 'Leaflet.markercluster'
56 },
57
58 // test results reporter to use
59 // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
60 reporters: ['dots'],
61
62 // web server port
63 port: 9876,
64
65 // level of logging
66 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
67 logLevel: config.LOG_WARN,
68
69 // enable / disable colors in the output (reporters and logs)
70 colors: true,
71
72 // enable / disable watching file and executing tests whenever any file changes
73 autoWatch: false,
74
75 // Start these browsers, currently available:
76 // - Chrome
77 // - ChromeCanary
78 // - Firefox
79 // - Opera
80 // - Safari (only Mac)
81 // - PhantomJS
82 // - IE (only Windows)
83 browsers: ['PhantomJS'],
84
85 // If browser does not capture in given timeout [ms], kill it
86 captureTimeout: 5000,
87
88 // Workaround for PhantomJS random DISCONNECTED error
89 browserDisconnectTimeout: 10000, // default 2000
90 browserDisconnectTolerance: 1, // default 0
91
92 // Continuous Integration mode
93 // if true, it capture browsers, run tests and exit
94 singleRun: true
95 });
96};