how to use log4js in test case with karma?

525 Views Asked by At

currently I need to add log4js support in my test case, like below:

it(' QuestionController saveQuestion method Testing ',  inject(function(localStorageService) {
    ***var log4js = require('log4js');
    var logger = log4js.getLogger();
    logger.debug("Some debug messages");***

    expect({}).toEqual(localStorageService.get('questionInfoStorage'));

  }));

I have tried to include the log4js js and repire js file in karma.conf.js file, it is not working and giving some error like "Module name "events" has not been loaded yet for context" something.

Is there anybody coming the same issue previously? thanks advance!

0

There are 0 best solutions below