showing results for - "karma config"
Maely
08 Jan 2020
1{
2  // Defaults to the Karma-Verbose-Reporter
3  // See https://www.npmjs.com/package/karma-verbose-reporter
4  reporters: ["verbose"],
5
6  // The browsers will vary depending on the OS.
7  // In CI/CD environments, FirefoxHeadless and ChromeHeadless are used instead.
8  browsers: ["Firefox", "Chrome"],
9
10  frameworks: [
11    // Defaults to the Mocha test framework.
12    "mocha",
13
14    // This makes it easy to detect which browser your tests are running in.
15    // Also provides access to environment variables.
16    // See https://jstools.dev/karma-host-environment
17    "host-environment"
18  ],
19
20  files: [
21    // Assumes your tests are under the "test" folder and are named *.spec.js
22    // or *.test.js.  (.mjs and .jsx file extensions are also supported)
23    "test/**/*.+(spec|test).+(js|jsx|mjs)",
24
25    // Allows your tests to dynamically access any file in the "test" folder.
26    // Useful for loading test data from CSV or JSON files.
27    { pattern: "test/**/*", included: false, served: true }
28  ],
29
30  preprocessors: {
31    // Uses Webpack to bundle your tests and their dependencies
32    "test/**/*.+(spec|test).+(js|jsx|mjs)": ["webpack"]
33  },
34
35  webpack: {
36    // Webpack development mode it easier to debug failing tests
37    mode: "development",
38
39    // Inlne source maps ensure proper stack traces in errors,
40    // and allow you to debug your original source code rather than bundled code.
41    devtool: "inline-source-map",
42  }
43}
44