-
Notifications
You must be signed in to change notification settings - Fork 35
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
Compatibility with gulp-mocha #19
Comments
An easy way to configure from within gulp would be nice too ;) |
Did you configure |
In gulp, and then I used an env prop to set the filename
|
Ok.. i just played with gulp and x-unit and you are right. var gulp = require('gulp');
var mocha = require('gulp-mocha');
var xunitFileReporter = require('xunit-file');
gulp.task('default', function () {
return gulp.src('test/myTest.test.js', {read: false})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: xunitFileReporter}));
//or reporter: "xunit-file"
});
The check mocha does is really error prone at the moment. Thanks for filing mochajs/mocha#1952 The problem is that a reporter should not depend on The reporter is an internal reporter thus it's ok to rely on a BaseReporter class. |
@nfriedly i just started making xunit-file a standalone reporter. If it works, we could do some more cleaning up and publish with gulp support. |
Yep, that works - it generates the xml output. The top-level (To clarify, with the <testsuite name="Mocha Tests" tests="1" failures="0" errors="0" skipped="0" timestamp="Sat, 31 Oct 2015 12:03:41 GMT" time="0.011">
<testcase classname="ZuulModel #createService()" name="should create pre and route filters" time="0.005"/>
</testsuite> but with <testsuite name="Mocha Tests" tests="0" failures="0" errors="0" skipped="0" timestamp="2015-10-31T12:02:50" time="NaN">
<testcase classname="ZuulModel #createService()" name="should create pre and route filters" time="0.005"/>
</testsuite> FYI, I'm going to be out for a fair part of the weekend, so it might take until Monday for me to get back to you. But it looks like you've got a good handle things. Thank you for doing this, it'll make my life much easier. |
Hi, I've raised mochajs/mocha#1956 on the xunit reporter to get their datetime formats changed. Though the NaN value for the time is a bit naughty:) |
Ok, cool. Thanks! |
BTW, I ended up grabbing https://github.com/juhovh/mocha-jenkins-reporter which did the trick for me + gives handy console output for when running the tests locally. So if you don't want to put a lot more work into this, then maybe just add a note to the readme pointing to that one. |
Thanks and sorry for the slow progress, but there is not enough time atm... Will consider adding alternatives to the README. |
Any idea how this can be resolved? |
@leomelzer is this resolved now? |
@tannerbaum hm, I'm not sure...but I don't think so, as work on @meaku's standalone branch never continued and it seems like a good way to clear this up. However I doubt the specific tooling issue is still relevant (it's been 5 years...). We could also close this as stale. What do you think? |
Hey, I can't seem to get this to load correctly inside of gulp-mocha, I think because my copy of mocha is "hidden" inside of gulp-mocha, so when this one runs
require("mocha")
it blows up. (If that's the cause, then npm v3.x will fix it, but it's still worth considering for older versions.)Also, mocha currently reports the wrong error message, I filed mochajs/mocha#1952 to address that.
The text was updated successfully, but these errors were encountered: