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.
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.