Comments (9)
I fixed this by requiring xunit-file first then running mocha. I'm using grunt so I just put require('xunit-file')
in Gruntfile.js
from xunit-file.
If you aren't using Grunt, then you can run Mocha programatically. Like this:
require('xunit-file');
var Mocha = require('mocha'),
mocha = new Mocha({
reporter: 'xunit-file'
});
mocha.addFile('file-you-want-to-test.js');
mocha.run(function() {});
from xunit-file.
Note: Using this setup will allow you to use jUnit-style reporting with Mocha and Jenkins.
from xunit-file.
@jfstgermain This is rather a node requiring problem than related to this module. I think putting the xunit-file
-module under node_modules
at your global mocha installation would do the trick.
from xunit-file.
@jhnns Just including xunit-file as a local dependency did not do the trick for me.
from xunit-file.
I don't know where mocha tries to look up reporters... but I'd expect it to be under <npm folder>/node_modules/mocha/node_modules
.
from xunit-file.
node_modules/xunit-file/package.json
has mocha as dev dependencies. So if I had not installed mocha, it was throwing Error: invalid reporter "xunit-file"
. I went to node_modules/xunit-file
and ran npm install
. It solved my problem.
from xunit-file.
Are you using npm 3.x?
from xunit-file.
Its 2.5.1
from xunit-file.
Related Issues (14)
- Propose: Make library compatible with PhantomJS HOT 3
- xml is no longer valid with the xunit plugin for Jenkins HOT 3
- Propose: Making xunit-file compatible with grunt-mocha-test HOT 2
- Proper config.json entry HOT 1
- Please include a LICENSE file
- Error: invalid reporter "xunit-file" HOT 1
- DateTime formats. HOT 10
- Compatibility with gulp-mocha HOT 13
- make it possible to create report file names as timestamp HOT 2
- Use semantic versioning HOT 2
- Support for outputs to multiple files? HOT 1
- path to config.js should not be module-relative HOT 1
- npm vulnerability found on dateformat dependency HOT 2
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 xunit-file.