Travis CI构建我的Angular应用程序并且所有测试都通过了:
Chrome 59.0.3071 (Linux 0.0.0): Executed 0 of 5 SUCCESS (0 secs / 0 secs)
e 59.0.3071 (Linux 0.0.0): Executed 1 of 5 SUCCESS (0 secs / 0.137 secs)
e 59.0.3071 (Linux 0.0.0): Executed 2 of 5 SUCCESS (0 secs / 0.178 secs)
'0 - {"isTrusted":true}'
Chrome 59.0.3071 (Linux 0.0.0): Executed 2 of 5 SUCCESS (0 secs / 0.178 secs)
ERROR: '0 - {"isTrusted":true}'
TypeError{}
Chrome 59.0.3071 (Linux 0.0.0): Executed 2 of 5 SUCCESS (0 secs / 0.178 secs)
LOG: TypeError{}
e 59.0.3071 (Linux 0.0.0): Executed 3 of 5 SUCCESS (0 secs / 0.391 secs)
'0 - {"isTrusted":true}'
Chrome 59.0.3071 (Linux 0.0.0): Executed 3 of 5 SUCCESS (0 secs / 0.391 secs)
ERROR: '0 - {"isTrusted":true}'
TypeError{}
Chrome 59.0.3071 (Linux 0.0.0): Executed 3 of 5 SUCCESS (0 secs / 0.391 secs)
LOG: TypeError{}
e 59.0.3071 (Linux 0.0.0): Executed 4 of 5 SUCCESS (0 secs / 0.512 secs)
e 59.0.3071 (Linux 0.0.0): Executed 5 of 5 SUCCESS (0 secs / 0.538 secs)
e 59.0.3071 (Linux 0.0.0): Executed 5 of 5 SUCCESS (0.556 secs / 0.538 secs)
在所有测试通过后,构建仍在运行,10分钟后构建因不活动而失败。
"No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated"
我的karma.conf:
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: true // tried false aswell
});
};
知道我错过了什么吗?有没有办法将测试版本标记为完整?
答案 0 :(得分:0)
是否因为您autoWatch: true
已启用?所以Karma还在运行,等待你的测试文件改变?
答案 1 :(得分:0)
尝试将--exit添加到package.json文件中
"scripts": {
"start": "node server.js",
"test": "mocha --exit"
},