我的业力茉莉花单元测试不适用于Firefox版本32.0.x. 这是我的karma.conf
module.exports = function (config) {
config.set({
preprocessors: {
// make html files accessable within a karma test
'app/views/**/*.html': ['ng-html2js'],
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'app/scripts/**/*.js': ['coverage']
},
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/json3/lib/json3.js',
'app/bower_components/es5-shim/es5-shim.js',
'app/bower_components/jquery/dist/jquery.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/bower_components/angular-resource/angular-resource.js',
'app/bower_components/angular-cookies/angular-cookies.js',
'app/bower_components/angular-sanitize/angular-sanitize.js',
'app/bower_components/angular-translate/angular-translate.js',
'app/bower_components/bison-corporatedesign/directives/headerbar.js',
'app/bower_components/angular-grid/ng-grid-2.0.13.debug.js',
'app/bower_components/angular-ui-utils/ui-utils.js',
'app/bower_components/angular-ui-router/release/angular-ui-router.js',
'app/bower_components/angular-animate/angular-animate.js',
'app/bower_components/AngularJS-Toaster/toaster.js',
'app/bower_components/angular-google-chart/ng-google-chart.js',
'app/bower_components/socket.io-client/dist/socket.io.min.js',
'app/bower_components/angular-dynamic-locale/src/tmhDynamicLocale.js',
'app/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
'app/scripts/directives/*.js',
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/spec/**/*.js',
'app/views/**/*.html'
],
reporters: ['progress', 'junit', 'coverage'],
// list of files / patterns to exclude
exclude: ['./**/*.js.map'],
// web server port
port: 9001,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS', 'Firefox'],
junitReporter: {
outputFile: 'distribution/junit/TESTS-results.xml'
},
coverageReporter: {
type: 'cobertura',
dir: 'distribution/cobertura/'
},
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});};
我使用karma-firefox-launcher。 当我运行grunt karma时,firefox将启动,但测试失败,因为没有通信。
Firefox控制台上的错误日志:
Error: Permission denied to access object
Error: Permission denied to access property 'result'
任何想法如何解决这个问题?旧版本效果很好。