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

Test against all supported versions of mocha #157

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

gabegorelick
Copy link
Contributor

There are reports (#148) of mocha-junit-reporter not working against certain versions of mocha. We really need to test more than one version of mocha to ensure that doesn't happen.

There are reports (michaelleeallen#148) of mocha-junit-reporter not working against
certain versions of mocha. We really need to test more than one version
of mocha to ensure that doesn't happen.
@@ -28,7 +28,15 @@
"chai": "^3.0.0",
"chai-xml": "^0.3.0",
"eslint": "^7.0.0",
"mocha": "^7.2.0",
"mocha": "^9.1.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version of mocha used when CI runs node_modules/.bin/mocha.

@@ -151,7 +153,7 @@ describe('mocha-junit-reporter', function() {

// We don't want Mocha to emit timeout errors.
// If we want to simulate errors, we'll emit them ourselves.
rootSuite.enableTimeouts(false);
rootSuite.timeout(0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Otherwise, this runner would intercept uncaught exceptions that were already handled by the mocha instance
// running our tests.
runner.dispose();
if (runner.dispose) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.dispose() isn't available in older versions of mocha.

Copy link
Collaborator

@clayreimann clayreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Halle-freakin'-lujah! 🎉 I had no idea how to accomplish this, but it's been on my list for a very long time!

@clayreimann clayreimann merged commit e062836 into michaelleeallen:master Oct 14, 2021
@gabegorelick gabegorelick deleted the mocha-matrix branch October 14, 2021 18:14
gabegorelick added a commit to gabegorelick/mocha-junit-reporter that referenced this pull request Oct 14, 2021
@gabegorelick
Copy link
Contributor Author

It looks like this is causing the build to fail (https://github.com/michaelleeallen/mocha-junit-reporter/runs/3895617023) due to a runner.dispose call that I missed. No idea how the build passed here.

Anyway here's a tentative fix: #159

gabegorelick added a commit to gabegorelick/mocha-junit-reporter that referenced this pull request Oct 14, 2021
gabegorelick added a commit to gabegorelick/mocha-junit-reporter that referenced this pull request Oct 14, 2021
gabegorelick added a commit to gabegorelick/mocha-junit-reporter that referenced this pull request Oct 14, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants