-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Not respecting Mocha version #4652
Comments
Repository with test code here: https://github.com/julian-sf/cypress-mocha-bug/tree/master |
Note: The reason I think it works with |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
Current behavior:
When attempting to override mocha version AND use an external reporter, cypress still internally loads mocha 2.5.3 which causes issues when attempting to use the reporters (I'll explain more below).
Desired behavior:
When specifying a mocha version, cypress uses that mocha version for ALL mocha-related activities, including
Suite
creation.Steps to reproduce: (app code and test code)
package.json
cypress.json
reporter-config.json
I first tried this with
mocha-multi-reporters
. This failed and is expected as per #3537. Fortunately, @YOU54F created a nice workaround in the package cypress-multi-reporters. Once I get past the issue in #3537; however, I run into a new issue when generating the report:I've determined that this is specific to using the
xunit
built-in mocha reporter. When using,reporter-config.json
everything works fine. What seems to happen is that cypress kicks off a test run and creates a
Mocha.Suite
. It then uses that suite to help collect the report and when it sends theSuite
over to the mocha 6 built-inxunit
reporter the above error occurs.The old version of mocha uses a different
Suite
object and is missing theisPending
method. What I can't seem to figure out is why cypress uses the internal mocha version and not the one installed innode_modules
. I validated that theSuite
is created with the internal mocha lib by placing the following line of code in thecreateSuite
function @packages/server/lib/reporter.js:56
:Which results in (the bundled
2.4.5
version of mocha):I checked the version like so:
Problem is, this is not the mocha version I specified... Is this expected behavior? Feels like it should respect the installed mocha version.
Versions
Mac OS X 10.14.5
The text was updated successfully, but these errors were encountered: