-
Notifications
You must be signed in to change notification settings - Fork 90
/
karma.conf.ts
50 lines (44 loc) · 1.2 KB
/
karma.conf.ts
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
import { Config, ConfigOptions } from "karma";
import { KarmaTypescriptConfig } from "karma-typescript/src/api/configuration";
const env = process.env.NODE_ENV || "development";
console.log(`*** Running karma in ${env} mode`);
function isDev(): boolean {
return env === "development";
}
const reporters = isDev()
? ["jasmine-diff", "mocha", "kjhtml", "karma-typescript"]
: ["jasmine-diff", "mocha", "karma-typescript"];
const browsers = isDev()
? ["Chrome"]
: ["PhantomJS"];
module.exports = function (config: Config) {
config.set({
reporters,
browsers,
frameworks: ["jasmine", "karma-typescript"],
files: [
"base.spec.ts",
"src/**/*.*(ts|html)",
],
preprocessors: {
"**/*.ts": ["karma-typescript"],
},
browserNoActivityTimeout: 100000,
karmaTypescriptConfig: {
coverageOptions: {
instrumentation: false,
},
tsconfig: "./tsconfig.spec.json",
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
transforms: [
require("karma-typescript-angular2-transform"),
],
},
compilerDelay: 500,
} as KarmaTypescriptConfig,
client: {
clearContext: false,
},
} as ConfigOptions);
};