Code Monkey home page Code Monkey logo

Comments (10)

cades avatar cades commented on June 10, 2024 2

@omatic-hacker Here's a patch code I wrote for my project, and how to use it.

from grunt-mocha.

matthewriley avatar matthewriley commented on June 10, 2024 1

Iā€™m seeing the same issue with XUnit failing due to isPending(). I originally reported it with mochajs (see referenced issue above), but it appears to originate with grunt-mocha.

I have some sample code that recreates this issue.

Mocha XUnit Reporter Sample
https://github.com/matthewriley/mocha-xunit-reporter-sample

from grunt-mocha.

ScottFreeCode avatar ScottFreeCode commented on June 10, 2024

Furthermore, it's possible to run the exact same test with "grunt-mocha-test" or "grunt-simple-mocha" and have the XUnit reporter work fine, but with "grunt-mocha" the isPending function is mysteriously missing when the test is sent to the XUnit reporter.

from grunt-mocha.

cades avatar cades commented on June 10, 2024

I found the root suit (for example, this) is not instanceof "mocha/lib/suite".

so isPending is not on its prototype chain. it this the root cause?

from grunt-mocha.

ScottFreeCode avatar ScottFreeCode commented on June 10, 2024

That function is not inheriting Suite because it is not a suite constructor; in fact, it's not even creating the root suite: it takes an existing suite as a parameter.

(You can also add console.log calls to the XUnit reporter to see that the tests are missing the isPending function.)

Additionally, the problem does not occur with Mocha itself and not with some other integrations either, so what we really need to determine is what Grunt-Mocha is doing differently.

from grunt-mocha.

cades avatar cades commented on June 10, 2024

Sorry I didn't state it clear, I mean that the parameter itself is the root suite, not the function.

from grunt-mocha.

ScottFreeCode avatar ScottFreeCode commented on June 10, 2024

Is Grunt-Mocha creating a root suite of its own without it inheriting Mocha's Suite? As far as I can tell, Mocha is creating the root suite here: https://github.com/mochajs/mocha/blob/master/lib/mocha.js#L85 using the Suite object from here: https://github.com/mochajs/mocha/blob/master/lib/mocha.js#L41

from grunt-mocha.

yurii-polishchuk avatar yurii-polishchuk commented on June 10, 2024

Hi guys, is there any workarounds for this bug? I would like to use grunt-mocha on my client side and generate xUnit reports, but always got: Fatal error: test.isPending is not a function

@kmiyashiro is the project is still maintained?

I really appreciate any help you can provide.

from grunt-mocha.

yurii-polishchuk avatar yurii-polishchuk commented on June 10, 2024

@cades Thanks, I will try your patch!

from grunt-mocha.

eugenet8k avatar eugenet8k commented on June 10, 2024

@omatic-hacker I fixed this problem in my fork of grunt-mocha-blanket(https://github.com/eugenet8k/grunt-mocha-blanket) which could be used instead of grunt-mocha. It's basically the same thing but with built-in blanketjs coverage support. Idk, maybe it will save you some time.

from grunt-mocha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.