File: karma.conf.js

package info (click to toggle)
node-i18next 19.8.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,416 kB
  • sloc: javascript: 9,893; makefile: 2
file content (60 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//const istanbul = require( 'browserify-istanbul' );

module.exports = function(karma) {
  karma.set({
    frameworks: ['mocha', 'chai', 'sinon', 'browserify'],

    files: [
      //'vendor/external.js',
      'test/**/*.spec.js',
      { pattern: 'test/locales/**/*.json', watched: true, included: false, served: true },
    ],

    proxies: {
      '/locales': 'http://localhost:9876/base/test/locales',
    },

    reporters: ['coverage', 'coveralls', 'spec'],

    preprocessors: {
      'test/**/*.spec.js': ['browserify'],
      'src/**/*.js': ['browserify', 'coverage'],
    },

    browsers: ['HeadlessChrome'],
    customLaunchers: {
      HeadlessChrome: {
        base: 'ChromeHeadless',
        flags: ['—no-sandbox'],
      },
    },

    port: 9876,

    //logLevel: 'LOG_DEBUG',

    //singleRun: true,
    //autoWatch: false,
    //
    // client: {
    //   mocha: {
    //     reporter: 'spec', // change Karma's debug.html to the mocha web reporter
    //     ui: 'tdd'
    //   }
    // },

    // browserify configuration
    browserify: {
      debug: true,
      transform: [
        ['babelify', { presets: ['@babel/preset-env'] }],
        /*'brfs',*/ 'browserify-istanbul',
      ],
    },

    coverageReporter: {
      type: 'lcov', //'html', // disabled - erroring now, https://github.com/karma-runner/karma-coverage/issues/157
      dir: 'coverage/',
    },
  });
};