]> git.proxmox.com Git - pve-eslint.git/blame - eslint/karma.conf.js
import 7.12.1 upstream release
[pve-eslint.git] / eslint / karma.conf.js
CommitLineData
eb39fafa 1"use strict";
6f036462 2const os = require("os");
eb39fafa 3
6f036462
TL
4if (os.arch() === "arm64") {
5
6 // For arm64 architecture, install chromium-browser using "apt-get install chromium-browser"
7 process.env.CHROME_BIN = "/usr/bin/chromium-browser";
8} else {
9 process.env.CHROME_BIN = require("puppeteer").executablePath();
10}
eb39fafa
DC
11
12module.exports = function(config) {
13 config.set({
14
15 // base path that will be used to resolve all patterns (eg. files, exclude)
16 basePath: "",
17
18
19 /*
20 * frameworks to use
21 * available frameworks: https://npmjs.org/browse/keyword/karma-adapter
22 */
23 frameworks: ["mocha"],
24
25
26 // list of files / patterns to load in the browser
27 files: [
28 "build/eslint.js",
29 "tests/lib/linter/linter.js"
30 ],
31
32
33 // list of files to exclude
34 exclude: [
35 ],
36
37
38 /*
39 * preprocess matching files before serving them to the browser
40 * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
41 */
42 preprocessors: {
43 "tests/lib/linter/linter.js": ["webpack"]
44 },
45 webpack: {
46 mode: "none",
47 stats: "errors-only"
48 },
49 webpackMiddleware: {
50 logLevel: "error"
51 },
52
53
54 /*
55 * test results reporter to use
56 * possible values: "dots", "progress"
57 * available reporters: https://npmjs.org/browse/keyword/karma-reporter
58 */
59 reporters: ["mocha"],
60
61 mochaReporter: {
62 output: "minimal"
63 },
64
65 // web server port
66 port: 9876,
67
68
69 // enable / disable colors in the output (reporters and logs)
70 colors: true,
71
72
73 /*
74 * level of logging
75 * possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
76 */
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 /*
85 * start these browsers
86 * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
87 */
88 browsers: ["HeadlessChrome"],
89 customLaunchers: {
90 HeadlessChrome: {
91 base: "ChromeHeadless",
92 flags: ["--no-sandbox"]
93 }
94 },
95
96 /*
97 * Continuous Integration mode
98 * if true, Karma captures browsers, runs the tests and exits
99 */
100 singleRun: true,
101
102 /*
103 * Concurrency level
104 * how many browser should be started simultaneous
105 */
106 concurrency: Infinity
107 });
108};