karma-runner / karma-ie-launcher

A Karma plugin. Launcher for Internet Explorer.
MIT License
59 stars 23 forks source link

Internet Explorer not found #14

Closed cthorne66 closed 10 years ago

cthorne66 commented 10 years ago

WARN [plugin]: Error during loading "... /node_modules/karma-ie-launcher" plugin: Internet Explorer not found

I have unit tests suites being run on multiple machines & virtual instances. This includes Mac and Windows OS. My Grunt file takes care of which browsers to execute against, based on the operating system. Up until v0.1.1 of this plugin, I wasn't having any issues, but since 0.1.2 I can now see the above warning in the console.

I can see where a warning/error would make sense if I was trying to run tests against an IE browser on a Mac, but since it's not, can this warning/error be suppressed? Or, do you have any other suggestions?

The error is being thrown inside of the getInternetExplorerExe() function in index.js

Thank you very much Chris

screen shot 2014-03-19 at 3 06 36 pm

sylvain-hamel commented 10 years ago

Have you considered handling this in your karma.config (or gruntfile):

var isWin = /^win/.test(process.platform);
...
config.set({
    browsers : isWin ? ['IE', 'Chrome'] : [Chrome]
});
bcbailey commented 10 years ago

I use litixsoft/karma-detect-browsers to automatically detect whatever browsers are on a users local machine. It adds karma-ie-launcher (among others) as a dependency to my project and so that gets installed even on my mac. By default karma loads all npm modules that start with karma-*, and this error occurs as soon as this launcher is required.

This behavior is inconsistent with the other launchers (ie: karma-opera-launcher, karma-chrome-launcher, etc.)

I understand the reason for the error, but is there any way to move the error message to a later time? Such as when the browser is actually attempted to be used? Or remove it and be consistent with the other launchers?

sylvain-hamel commented 10 years ago

Ok, I'll look into that possibility of delaying the moment when we throw the error until we are ready to spawn the process. I'll get back to you soon.

cthorne66 commented 10 years ago

@sylvain-hamel, I do actually have that check you mentioned setting the option in the gruntfile.js for my Karma config. Unfortunately it still throws an error, though the IE browser is never actually invoked.

Thanks for your help!

sylvain-hamel commented 10 years ago

I see. I agree that it doesn't really make sense to throw just because the plug-in is loaded.