Skip to content
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

Not possible to use third party reporters on Windows #47

Closed
nosachamos opened this issue Dec 18, 2014 · 1 comment
Closed

Not possible to use third party reporters on Windows #47

nosachamos opened this issue Dec 18, 2014 · 1 comment

Comments

@nosachamos
Copy link

When I attempt to use a built in reporter such as dot or xunit, it works fine. But If I attempt to use a third party reporter such as xunit-file or mocha-teamcity-reporter, then I get this error:

$ mocha-casperjs testcase.js --url=http://nextview-smoke.internalassemble.com --reporter=xunit-file

$ Error: Cannot find module 'path'
  C:/Work/Assemble/Tests/Assemble/Assemble.Integration/mocha-casper.tests/phantomjs:/bootstrap.js:289
  C:/Work/Assemble/Tests/Assemble/Assemble.Integration/mocha-casper.tests/phantomjs:/bootstrap.js:254 in require
  C:/Users/Admin/AppData/Roaming/npm/node_modules/mocha/lib/mocha.js:11
  C:/Users/Admin/AppData/Roaming/npm/node_modules/mocha/lib/mocha.js:408

I saw in a IRC log someone mentioning that this error occurs when the reporter runs in nodejs instead of phantomjs. I'n not sure how to fix it.

I'm working this around by using the xunit reporter and directing the console output to a file, then having teamcity process that result file. But then I cannot print any messages during my tests (else the XML in that redirected file gets corrupted).

The easiest way to repro is to have node on Windows (I'mm on Windows 8.1), then install xunit-file reporter and try using it.

@nathanboktae
Copy link
Owner

You got it backwards, but yes - the reporters run in PhantomJS, not Node.js, as noted in the readme. path is a Node.js specific module so it will not run in PhantomJS or the browser for mocha-phantomjs.

I see alot of issues regaurding xunit reporter on mocha-phantomjs, like nathanboktae/mocha-phantomjs#161 - see if those help you. Basically the xunit reporter just needs to use vanilla javascript to run, or depend on a XML module that it and all it's dependencies don't need node or browser specifics (big ask I know).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants