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

Using Mocha Programmatically should support more than paths #3284

Closed
3 of 4 tasks
Starmann opened this issue Mar 16, 2018 · 4 comments
Closed
3 of 4 tasks

Using Mocha Programmatically should support more than paths #3284

Starmann opened this issue Mar 16, 2018 · 4 comments
Labels
area: usability concerning user experience or interface status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: feature enhancement proposal

Comments

@Starmann
Copy link

Starmann commented Mar 16, 2018

Prerequisites

  • Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
  • Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --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.

@outsideris outsideris added area: usability concerning user experience or interface type: feature enhancement proposal labels Mar 16, 2018
@boneskull
Copy link
Contributor

@Starmann What's the real use case here?

@Starmann
Copy link
Author

Starmann commented Mar 19, 2018

@boneskull
Glad you asked. I'm trying to modify the code first using an Abstract Syntax Tree.

@YoSev
Copy link

YoSev commented Jun 4, 2020

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)

@JoshuaKGoldberg
Copy link
Member

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!

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
@JoshuaKGoldberg JoshuaKGoldberg added the status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: usability concerning user experience or interface status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

5 participants