michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.
MIT License
144 stars 153 forks source link

fix: Mocha version comparison fix #198

Open 97andrewvaldez opened 10 months ago

97andrewvaldez commented 10 months ago

When upgrading to Mocha v10 this string comparison broke and started setting the mocha6plus variable to false. This doesn't allow the statsCollector to later get attached to the runner and caused us some issues in our pipeline.

I added semver as a simple way to check the correct versioning. If it's preferable to make a helper method instead of adding a new npm package I can do that too.

Either way, this should fix some inconsistencies that occur when using newer versions of Mocha.