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

Add the ability to list files to be tested #3581

Closed
plroebuck opened this issue Nov 26, 2018 · 9 comments
Closed

Add the ability to list files to be tested #3581

plroebuck opened this issue Nov 26, 2018 · 9 comments
Labels
area: usability concerning user experience or interface nice to have enhancement proposal of low priority

Comments

@plroebuck
Copy link
Contributor

plroebuck commented Nov 26, 2018

Description

Output files to be tested (in load order) with the debug package using the namespace 'mocha:files' in "bin/_mocha" file.

var debug = require('debug')('mocha:files');    // immediately before L16
...
debug('files:', files);    // L575

Additional Information

Test as follows:

  1. Using default "test" directory
$ DEBUG='mocha:files' mocha --recursive
  1. Using extended glob (results should be same as case 1)
$ DEBUG='mocha:files' mocha 'test/**/*.js'
  1. Using default "test" directory, excluding files in subdir "setup"
$ DEBUG='mocha:files' mocha --exclude 'test/setup/**' --recursive
  1. Using extended glob, excluding files in subdir "setup" (results should be same as case 3)
$ DEBUG='mocha:files' mocha --exclude 'test/setup/**' 'test/**/*.js'
  1. Using default "test" directory, with prepended file "test/setup/init.js"
$ DEBUG='mocha:files' mocha --file test/setup/init.js --exclude 'test/setup/**' --recursive
  1. Using extended glob, with prepended file "test/setup/init.js" (results should be same as case 5)
$ DEBUG='mocha:files' mocha --file test/setup/init.js --exclude 'test/setup/**' 'test/**/*.js'
@plroebuck plroebuck added nice to have enhancement proposal of low priority area: usability concerning user experience or interface good first issue new contributors should look here! labels Nov 26, 2018
@holybubbles
Copy link

Anybody mind if I take this one?

@plroebuck
Copy link
Contributor Author

Exists in Mocha-6.0 (though hate the namespace) using:

$ DEBUG='mocha:cli:run:helpers' mocha --recursive

@holybubbles
Copy link

So should someone close this issue? Since it's already fixed now?

@plroebuck
Copy link
Contributor Author

I'll leave it open for now and see if I can use a simpler namespace...

@boneskull
Copy link
Contributor

@plroebuck I'm confused; is this intended to be user-facing? If so, DEBUG is sort of a wonky way to do it. It would be cool to see:

  1. A list of all test files
  2. A tree of all test files and user code (stuff not in a node_modules)
  3. A --dry-run which would dump all suites but not run any tests

@boneskull boneskull removed the good first issue new contributors should look here! label Feb 26, 2019
@boneskull
Copy link
Contributor

Given the cross-cutting concerns that such an implementation would need to touch, I don't think this is a good candidate for a first issue

@johnwhelchel
Copy link

This was implemented and closed quite quickly it seems.

Can we re-open this PR?

It seems like something a lot of people would like!

#1070

@sh3raawii
Copy link

You are welcome
https://github.com/sh3raawii/mocha-decaf

@JoshuaKGoldberg
Copy link
Member

Fixed by #4640. 🚀

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 nice to have enhancement proposal of low priority
Projects
None yet
Development

No branches or pull requests

6 participants