问题
I'm trying to run karma as a webpack plugin. This is just:
var Server = require('karma').Server;
new Server({
configFile: config,
singleRun: true
}, doneCallback }).start();
The outer ionic-cli package is using winston logger while karma uses log4js and I assume they're conflicting so as a result I'm getting errors like:
24 02 2016 00:54:52.530:ERROR [karma]: [TypeError: Can't call method on undefined]
TypeError: Can't call method on undefined
at TypeError (native)
at module.exports (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/_defined.js:3:28)
at createHTML (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/_string-html.js:7:19)
at bold (/Users/szymon/git/ionic-movie-app/node_modules/karma/node_modules/core-js/modules/es6.string.bold.js:5:12)
at cb (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/winston/lib/winston/logger.js:206:7)
because the two loggers are overriding something probably on String prototype. I wonder what are the possibilities to avoid this. I assume that it is not an option to alter either karma or ionic packages.
来源:https://stackoverflow.com/questions/35597719/log4js-and-winston-loggers-conflicting-when-trying-to-run-karma-from-ionic-cli