mocha: "it.skip" throws an exception (when running e2e with protractor)
Recently I noticed that adding a “skip” to an “it” cause an exception, and tests are failing to run. I think it is related to some Mocha/Protractor packages mismatch, but not sure. I couldn’t find a working configuration easily.
Currently we use: Protractor: 3.0.0 Mocha: 3.0.2
Downgrading mocha to 2.4.5 solves the issue (but we miss some features and bug fixes we need). I see this was discussed here: http://stackoverflow.com/questions/38876476/running-protractor-tests-with-jenkins-throws-test-title-should-be-a-string
Any plan to fix this in future mocha versions / is it a protractor issue?
This is the error and stack trace we get:
Error: Test title
should be a “string” but “function” was given instead.
at new Test (/Users/benbracha/workspace/ravelloui/ravello-ui/node_modules/mocha/lib/test.js:24:11)
at context.it.context.specify (/Users/benbracha/workspace/ravelloui/ravello-ui/node_modules/mocha/lib/interfaces/bdd.js:84:18)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 15 (5 by maintainers)
Hi everyone,
For your information, I faced the same problem, so I tried to find out a solution and in my opinion it’s on the protractor side. So I create an issue on protractor github: https://github.com/angular/protractor/issues/4010. Let’s see if they agree with me 😃
Anyway, I have a quick and dirty fix (but still a fix) to this issue, by adding the following code in describe function :
The good news is that code makes all the suite work again.
The bad news is that code makes skipped tests behaved like sucessfull tests.
Hope it helps.
I have this issue also. Using Mocha version": “3.1.2” :