Giter VIP home page Giter VIP logo

Comments (9)

bendangelo avatar bendangelo commented on July 17, 2024

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.

gfranko avatar gfranko commented on July 17, 2024

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.

gfranko avatar gfranko commented on July 17, 2024

Note: Using this setup will allow you to use jUnit-style reporting with Mocha and Jenkins.

mochajs/mocha#83

from xunit-file.

jhnns avatar jhnns commented on July 17, 2024

@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.

gfranko avatar gfranko commented on July 17, 2024

@jhnns Just including xunit-file as a local dependency did not do the trick for me.

from xunit-file.

jhnns avatar jhnns commented on July 17, 2024

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.

ashwinaggarwal avatar ashwinaggarwal commented on July 17, 2024

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.

meaku avatar meaku commented on July 17, 2024

Are you using npm 3.x?

from xunit-file.

ashwinaggarwal avatar ashwinaggarwal commented on July 17, 2024

Its 2.5.1

from xunit-file.

Related Issues (14)

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.