Comments (10)
@omatic-hacker Here's a patch code I wrote for my project, and how to use it.
from grunt-mocha.
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.
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.
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.
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.
Sorry I didn't state it clear, I mean that the parameter itself is the root suite, not the function.
from grunt-mocha.
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.
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.
@cades Thanks, I will try your patch!
from grunt-mocha.
@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)
- Source maps
- Is there a way to run this without phantomjs? HOT 1
- XUnit: invalid XML if running multiple suites HOT 4
- Ability to pass TZ parameter to Phantom HOT 1
- iframe, embed, and objects intermittently fail, onLoadFinished gets called multiple times HOT 3
- JSON reporter doesn't write output to file HOT 5
- Phantom JS Timing Out HOT 2
- option for mocha-clean HOT 5
- how to change filepath for html_table_reporter in reporter options HOT 1
- Support for --compilers option
- PhantomJS hangs around after tests HOT 2
- Support for --recursive flag HOT 1
- Mocha reporters don't have results HOT 1
- Bump grunt-lib-phantomjs to ^1.0.0 HOT 6
- [Request] Support for retry arg
- Update to Latest Grunt please? HOT 1
- the mocha task results and the browser test results not the same HOT 1
- Please, add tag 1.02 HOT 1
- Does it make sense to archive this repository?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-mocha.