badeball / karma-jsdom-launcher

A Karma plugin. Launcher for jsdom.
MIT License
37 stars 16 forks source link

Config option to don't clear shell output #33

Closed yuki-93 closed 5 years ago

yuki-93 commented 5 years ago

Hey, when I run karma with jsdom as browser, it clears the shell output. It looks like the jsdom-launcher or jsdom clears the shell. Is it possible to switch this generally of or providing a config option for my karma config file. Thanks

badeball commented 5 years ago

Hello, @yuki-93

Since 3.0.0, Karma will attempt to clear the console of any content. When running Karma with jsdom, this will essentially clear your screen, as per node's spec. You can avoid this yourself by removing the "clear" property on console for the duration of your tests, as shown here [3].

I will see if I can add this as a configurable option.

vediga commented 5 years ago

Im facing the same issue with my angular app, tried removing 'clear' property as suggested in test.ts but it doesn't seem to be working. Did you add any config option for the same?

badeball commented 5 years ago

Hi, @vediga. I've changed the default behavior to provide a non-clearing virtual console to JSDOM by default, to avoid this issue. I believe this is the least surprising behavior to users and that few will miss it. It's published as v8.0.0.