-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add a --file <filename> option for json-cov, json and html-cov reporters #469
Conversation
why not just redirect stdio? |
Actually I work with nherment, so that's for the same reasons he mentioned on this topic: #304 (comment) |
Hi, We working on big project uses Express and Mocha as testing framework. |
You can cat the head and tail bits. Mocha's documentation is supposedly generated with this (from the "doc" documentation: http://visionmedia.github.com/mocha ): test-docs: |
Hi badunk, |
I just did a search and this came up: #83 |
Hi badunk, |
Hi badunk, |
I have not tried any of those solutions myself, all I did was read documentation :) I don't know if commenting back and forth on this pull request is the best place to get your answer. If this is a blocker for you, I suppose you can try hostalerye's pull request. |
Ok, thanks |
+1 for supporting file options to html-cov, because I'm writing some testcases which makes HTTP request to my developing services, and these services can't give me coverage results. I wrote my own coverage-write function, but mocha's reporter doesn't support arbitrary filenames... |
https://npmjs.org/package/xunit-file Seems to work well, generates a file called xunit.xml seems good enough for now. The need for this is real, since tests may produce useful logging, and expecting the only output from tests to be xml is overly simplistic. |
I think it would still be useful to provide the file name parameter that's in this pull request because some node modules also emit their own messages to stdout (and don't provide a method to disable them). This is the hack I settled on to get my coverage JSON:
|
Why are you not merging this? It is very annoying for using Jenkins with output like this: Express server "undefined" listening on port 8000 in development mode Then Jenkins complains: Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. |
+1 I have some modules output before the html when piping stdio ... |
This feature would be useful in Grunt environment. Now I have to do in this way with exec plugin, but with this feature I could use the proper mochaTest with file option. exec: {
coverage: {
command: 'mocha -R html-cov ./test/**/*.js > /tmp/coverage.html && open /tmp/coverage.html',
stout: true
}
}, |
This option allows the user to write the report in a file