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

display test duration #105

Open
nweldev opened this issue Aug 13, 2019 · 1 comment
Open

display test duration #105

nweldev opened this issue Aug 13, 2019 · 1 comment

Comments

@nweldev
Copy link

nweldev commented Aug 13, 2019

I would like to display tests duration in the console like with the spec reporter (see https://mochajs.org/#test-duration), but can't figure out how to do it with karma-mocha-reporter.

When adding https://mochajs.org/api/mocha#slow to client.mocha in karma.config, it doesn't change anything:

client: {
        mocha: {
          slow: 0
        }
 }
@AdamVig
Copy link

AdamVig commented Aug 28, 2019

@noelmace I found myself in the same situation. After some research, I discovered that this reporter actually already supports displaying test duration.

You can use the standard Karma reportSlowerThan configuration property (Karma configuration docs). It defaults to zero, which disables it.

Setting the property to 0.001 made Karma report duration for every one of my test cases, but I assume that the number is situation-dependent.

If you're curious, this project's logic for reporting slow tests is here.

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

2 participants