Closed Starmann closed 10 months ago
@Starmann What's the real use case here?
@boneskull Glad you asked. I'm trying to modify the code first using an Abstract Syntax Tree.
I am looking for such a solution as well. If i understood @Starmann right, he would like to execute tests programmatically to be able to evaluate the results for further processing. Same goes for me. Those tests are coming via an api (so the webinterface), having access to mocha results as json(streams) would be very handy for a lot of things like notifications etc. (i use mocha for scheduled tests against remote RestAPI's for example)
This seems like a very niche request. It would probably be resolved by #1457... but without more detail, it's hard to say.
Closing as wontfix. But if someone reading this really wants this feature, please do file a new issue with our new feature template & describe your situation. I'd be interested to know more. Thanks!
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.Description
Mocha's programmatic API currently only supports adding files via a path. The problem with this is that the developer might want to process the Javascript first. Although support for Streams would be the ideal, simply being able to evaluate strings via Mocha would be greatly appreciated.