-
Notifications
You must be signed in to change notification settings - Fork 153
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
testsuite time does not include setup or teardown #114
Labels
Comments
gabegorelick
added a commit
to gabegorelick/mocha-junit-reporter
that referenced
this issue
May 9, 2020
The `time` attribute on `testsuite` should equal the amount of time between the runner issuing the `suite start` and `suite end` events. It was previously calculated as the sum of each individual testcase's `time`, but that doesn't account for setup and teardown. Similarly, total time for all testsuites should be the amount of time between the `start` and `end` events, which the `Base` reporter stores in `stats.duration` for us. Fixes michaelleeallen#114
PR: #115 |
gabegorelick
added a commit
to gabegorelick/mocha-junit-reporter
that referenced
this issue
May 9, 2020
The `time` attribute on `testsuite` should equal the amount of time between the runner issuing the `suite` and `end suite` events. It was previously calculated as the sum of each individual testcase's `time`, but that doesn't account for setup and teardown. Similarly, total time for all testsuites should be the amount of time between the `start` and `end` events, which the `Base` reporter stores in `stats.duration` for us. Fixes michaelleeallen#114
gabegorelick
added a commit
to gabegorelick/mocha-junit-reporter
that referenced
this issue
Jun 20, 2020
The `time` attribute on `testsuite` should equal the amount of time between the runner issuing the `suite` and `end suite` events. It was previously calculated as the sum of each individual testcase's `time`, but that doesn't account for setup and teardown. Similarly, total time for all testsuites should be the amount of time between the `start` and `end` events, which the `Base` reporter stores in `stats.duration` for us. Fixes michaelleeallen#114
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like
testsuite
(andtestsuites
) is calculating thetime
attribute by summing the time each testcase took. However, this ignores the amount of time that setup and teardown take.Example test:
Mocha's
spec
andxunit
reporters correctly output that this suite took 1s. Here's thexunit
output for example:However, mocha-junit-reporter incorrectly reports that the entire testsuite took 0s:
Relevant code:
mocha-junit-reporter/index.js
Lines 404 to 413 in 94016cc
The text was updated successfully, but these errors were encountered: