2016-04-04 14 views
0

私はJasmineを使用したKarmaテストの初心者です。なぜ私のdebugコマンドでAngularJsアプリの出力が表示されないのかわかりますコンソールでテストします。'karma start'はコンソールに出力を表示しません

この場合も、コンソールはブラウザではなく出力を表示しないコンソールです。私は、ブラウザが何らかの出力を見せると思っていた人々の他の質問を見てきました。私はそれがうまく動作しないことを知っています。

テストのように動作しますが、実際には停止しません。私はkarma.confでおそらく 'basePath'か 'files'を使って何かを推測しています。

これは私のkarma.confファイルです:これは私がカルマが開くことをブラウザインスタンスで「デバッグ」ボタンをクリックしたときに、私のコンソールが

enter image description here

どのように見えるかです

// Karma configuration 
// Generated on Sun Apr 03 2016 15:29:19 GMT-0300 (Hora Padrão da Bahia) 

module.exports = function(config) { 
config.set({ 

// base path that will be used to resolve all patterns (eg. files, exclude) 
basePath: '', 


// frameworks to use 
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter 
frameworks: ['jasmine'], 


// list of files/patterns to load in the browser 
files: [ 
    '../../tests/**/*.js', 
    '../../src/**/*.js' 
], 


// list of files to exclude 
exclude: [ 
], 


// preprocess matching files before serving them to the browser 
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 
preprocessors: { 
}, 


// test results reporter to use 
// possible values: 'dots', 'progress' 
// available reporters: https://npmjs.org/browse/keyword/karma-reporter 
reporters: ['progress'], 


// web server port 
port: 9876, 


// enable/disable colors in the output (reporters and logs) 
colors: true, 


// level of logging 
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 
logLevel: config.LOG_INFO, 


// enable/disable watching file and executing tests whenever any file changes 
autoWatch: true, 


// start these browsers 
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 
browsers: ['Chrome'], 


// Continuous Integration mode 
// if true, Karma captures browsers, runs the tests and exits 
singleRun: false, 

// Concurrency level 
// how many browser should be started simultaneous 
concurrency: Infinity 
}) 
} 

「カルマスタート」。それはこれのようにとどまりませんし、何も出力を変更したり表示したりしません。

これで私を助けることができますか?あなたのカルマの設定 loggers : [ { type: 'console' } ], にこれを追加すること

+0

をチェックし、あなたがphantomJSを使用するとChromeない場合は、コンソールに出力を参照していますか? –

答えて

0

てみてください。また client.captureConsole Type: Boolean Default: true Description: Capture all console output and pipe it to the terminal.

関連する問題