jeudi 5 janvier 2017

Karma and Chrome

Running "karma start" opens and then closes the Chrome browser and I can not see the graphics. I can only see it by console. Someone can help me, which I must change to stay open Chrome. Thank you.

My file karma.conf.js:

'use strict';
var path = require('path');
var conf = require('./gulp/conf');
var _ = require('lodash');
var wiredep = require('wiredep');  
var pathSrcHtml = [
 path.join(conf.paths.src, '/**/*.html')
];

function listFiles() {
var wiredepOptions = _.extend({}, conf.wiredep, {
dependencies: true,
devDependencies: true
});
var patterns = wiredep(wiredepOptions).js
.concat([
  path.join(conf.paths.src, '/app/**/*.module.js'),
  path.join(conf.paths.src, '/app/**/*.js'),
  path.join(conf.paths.src, '/**/*.spec.js'),
  path.join(conf.paths.src, '/**/*.mock.js'),
])
.concat(pathSrcHtml);

var files = patterns.map(function(pattern) {
return {
  pattern: pattern
};
});
files.push({
pattern: path.join(conf.paths.src, '/assets/**/*'),
included: false,
served: true,
watched: false
});
return files;
}

module.exports = function(config) {

 var configuration = {
files: listFiles(),

singleRun: true,

autoWatch: false,

ngHtml2JsPreprocessor: {
  stripPrefix: conf.paths.src + '/',
  moduleName: '01'
},

logLevel: 'WARN',

frameworks: ['phantomjs-shim', 'jasmine', 'angular-filesort'],

angularFilesort: {
  whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')]
},

browsers: ['Chrome', 'Chrome_without_security'],

plugins: [
  'karma-chrome-launcher',
  'karma-phantomjs-launcher',
  'karma-angular-filesort',
  'karma-phantomjs-shim',
  'karma-coverage',
  'karma-jasmine',
  'karma-ng-html2js-preprocessor'
],

coverageReporter: {
  type: 'html',
  dir: 'coverage/'
},

reporters: ['progress'],

proxies: {
  '/assets/': path.join('/base/', conf.paths.src, '/assets/')
}
};
configuration.preprocessors = {};
pathSrcHtml.forEach(function(path) {
configuration.preprocessors[path] = ['ng-html2js'];
});
configuration.customLaunchers = {
Chrome_without_security: {
  base: 'Chrome',
  flags: ['--disable-web-security']
}
};
config.set(configuration);
};

Aucun commentaire:

Enregistrer un commentaire