问题描述
我有一个相当简单的karma.config.js文件
I have a fairly simple karma.config.js file
basePath = '../';
files = [
JASMINE,
JASMINE_ADAPTER,
'js/lib/angular*.js',
'test/lib/angular/angular-mocks.js',
'js/**/*.js',
'test/unit/**/*.js'
];
autoWatch = true;
browsers = ['PhantomJS'];
当我运行 karma start config / karma.conf.js --single-run
我收到以下输出
$ karma start config/karma.conf.js --single-run
[2013-06-24 23:47:08.750] [DEBUG] config - autoWatch set to false, because of singleRun
INFO [karma]: Karma server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9 (Mac)]: Connected on socket id LwMoWxzIbSUuBsvIqB_m
PhantomJS 1.9 (Mac): Executed 6 of 6 SUCCESS (0.073 secs / 0.02 secs)
我一直在寻找告诉我如何得到记录的测试输出的东西(例如 SUCCESS单位:服务myService应该表现
)
I've been searching for something to tell me how to get the output of the tests that get logged (e.g. SUCCESS Unit: services myService should behave
)
我能看到测试输出的唯一方法是打开Chrome并单击Debug,然后显示开发人员工具控制台。我希望将消息记录到终端,但我无法弄清楚如何使其正常工作。
The only way I can see the output of the tests is to open Chrome and click 'Debug', then show the developer tools console. I want the messages to be logged out to the terminal, but I cannot figure out how to get this working.
推荐答案
修正者安装
npm install karma-spec-reporter --save-dev
并添加此我的karma.config .js
and adding this my karma.config.js
记者:['spec'],
根据
但是有些用户不得不在他们的配置中添加以下内容
but some users have had to add the following to their config
插件:['karma-spec-reporter ']
这篇关于需要适当的记者为业力茉莉花的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!