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

Reporter fails with Mocha 4.0.0 #192

Closed
Kporal opened this issue Oct 6, 2017 · 2 comments
Closed

Reporter fails with Mocha 4.0.0 #192

Kporal opened this issue Oct 6, 2017 · 2 comments

Comments

@Kporal
Copy link

Kporal commented Oct 6, 2017

Issue

When using mochawesome 2.3.1 with Mocha 4.0.0 the reporter fails when I've errors in my tests.

I've the following error in the console:

/test/node_modules/mocha/lib/reporters/base.js:227
    test.titlePath().forEach(function (str, index) {
         ^

TypeError: test.titlePath is not a function
    at /test/node_modules/mocha/lib/reporters/base.js:227:10
    at Array.forEach (<anonymous>)
    at Function.exports.list (/test/node_modules/mocha/lib/reporters/base.js:167:12)
    at Spec.Base.epilogue (/test/node_modules/mocha/lib/reporters/base.js:344:10)
    at emitNone (events.js:110:20)
    at Runner.emit (events.js:207:7)
    at /test/node_modules/codeceptjs-webdriverio/node_modules/mocha/lib/runner.js:812:12
    at done (/test/node_modules/codeceptjs-webdriverio/node_modules/mocha/lib/runner.js:649:7)
    at Runner.next [as nextSuite] (/test/node_modules/codeceptjs-webdriverio/node_modules/mocha/lib/runner.js:616:16)
    at Runner.uncaught (/test/node_modules/codeceptjs-webdriverio/node_modules/mocha/lib/runner.js:737:17)

It seems to be caused by this change from the 4.0.0 release of Mocha.

How to reproduce

Create a test.js which generates an error and run mocha test.js --reporter mochawesome

@adamgruber
Copy link
Owner

@Kporal Can you provide some actual code that reproduces this issue? I tried creating a failing test as you suggest but did not get the error.

// test.js
const chai = require('chai');
chai.should();

describe('test', () => {
  it('fails', () => {
    (1 + 1).should.eql(3);
  });
});

@Kporal
Copy link
Author

Kporal commented Oct 9, 2017

@adamgruber you're right. I found out that this bug is due to codeceptjs. It's the tool that I am using for running my E2E tests. I will open an issue on their Github repository and will close this one. Thanks

@Kporal Kporal closed this as completed Oct 9, 2017
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

No branches or pull requests

2 participants