Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated output in terminal #44

Open
Noxxys opened this issue Jun 2, 2017 · 6 comments
Open

Duplicated output in terminal #44

Noxxys opened this issue Jun 2, 2017 · 6 comments

Comments

@Noxxys
Copy link

Noxxys commented Jun 2, 2017

All the log / warning / error output in the terminal appears twice: once without colors and once with colors.
I've been unable so far to fix that or even understand why it's happening. I'm using the exact same configuration as the one in this repo.
Screenshot

@leifwells
Copy link
Contributor

I find it annoying, too, especially when errors spit out really long messages. I've looked into this issue as well, but haven't found a solution. I'm not even sure if this behavior isn't expected.

@datencia
Copy link
Contributor

datencia commented Jun 2, 2017

Seems to be related to the number of reporters used: reporters: ['kjhtml', 'dots']. Both reporters send output to the console.

The first one (without colors) corresponds to the kjhtml reporter, the second one (with colors) belongs to the dots reporter.

E.g. you can execute $ npm test -- --reporters dots to check it out using only the dots reporter.

@Noxxys
Copy link
Author

Noxxys commented Jun 6, 2017

This is indeed the problem. kjhtml is still useful because it allows to debug the tests in chrome. dots is useful to follow the progress and result of the tests in the console.
I'm trying to disable the console output from kjhtml but it seems there is not setting for that. There is an open issue on their Github

@leifwells
Copy link
Contributor

Thanks, @Noxxys, for following up on an issue you created with more information. More people should do that. It makes everyone's lives easier.

Other than waiting for a fix from the kjhtml team, is there anything else that can be done?

@Noxxys
Copy link
Author

Noxxys commented Jun 14, 2017

If someone has a workaround to use both kjhtml and dots without duplicated output, I'm interested. Otherwise I don't know what can be done.

@morphatic
Copy link

I created a patch for kjhtml that resolves this issue. It's not ideal, but it gets rid of the annoying duplicate terminal output when you have more than one reporter enabled. As it doesn't appear that this package is being actively maintained, an immediate workaround is to load the plugin directly from my git repo. To do this, in your package.json file, swap this line:

    "karma-jasmine-html-reporter": "^0.2.2",

with this one:

    "karma-jasmine-html-reporter": "git+https://github.com/morphatic/karma-jasmine-html-reporter.git#master",

Then delete your node_modules folder (i.e. rm -fr node_modules) and reinstall all of your packages, npm install. I haven't tested it extensively, but I was at least able to get it working with the dots reporter and also with karma-mocha-reporter which I like better than dots. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants