问题
THE SITUATION:
I am currently running AngularJs unit tests in the console.
I open the folder in the console and i run karma start
and check the result of the tests in the console.
I would like to see the results in the browser but I cannot see them so far. All i can see is this:
THE QUESTION:
How can i see the reports of the tests in the browser? The proper plugin should be karma-jasmine-html-reporter right?
THE CONFIGURATION:
karma.conf.js:
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'./test/**/*.js',
'app.js'
],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-jasmine-html-reporter'
],
browsers: ['PhantomJS', 'Chrome'],
回答1:
Assuming you have jasmine 2.0,
add in
reporters: ['html'],
to yourkarma.conf.js
In the chrome page hit the
DEBUG
button. You should be taken to a new page that has the report.
来源:https://stackoverflow.com/questions/32243100/jasmine-how-to-see-the-reports-in-the-browser