Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Commit b33809b

Browse files
committed
修复测试脚本
1 parent fcd6e4a commit b33809b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

karma.conf.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ module.exports = function(config) {
44
frameworks: ['jasmine', 'karma-typescript'],
55
files: ['src/**/*.ts', 'test/**/*.ts'],
66
preprocessors: {
7-
'**/*.ts': ['karma-typescript']
7+
'src/**/*.ts': ['karma-typescript', 'coverage'],
8+
'test/**/*.ts': ['karma-typescript']
89
},
9-
reporters: ['progress'],
10+
reporters: ['progress', 'coverage', 'karma-typescript'],
1011
karmaTypescriptConfig: {
1112
compilerOptions: {
1213
lib: ['dom', 'es2015']
13-
},
14-
coverageOptions: {
15-
exclude: /\.(d|spec|test|helper)\.ts/i
1614
}
1715
},
1816
port: 9876,
@@ -23,7 +21,17 @@ module.exports = function(config) {
2321
singleRun: true
2422
}
2523

26-
if (!process.env.TRAVIS) {
24+
if (process.env.TRAVIS) {
25+
c.karmaTypescriptConfig.reports = {
26+
lcovonly: {
27+
dir: 'coverage',
28+
subdirectory: 'lcov'
29+
}
30+
}
31+
} else {
32+
c.karmaTypescriptConfig.reports = {
33+
html: 'coverage'
34+
}
2735
c.browsers.push('Chrome')
2836
}
2937

test/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface FakeObj {
1010
}
1111

1212
const fakeObj: FakeObj = {
13+
// tslint:disable-next-line:no-empty
1314
method() {}
1415
}
1516

0 commit comments

Comments
 (0)