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

Should not throw error when files.length == 0 #2001

Closed
wants to merge 2 commits into from

Conversation

mariodu
Copy link

@mariodu mariodu commented Dec 10, 2015

Directory structure likes below:

tests/
    units/

In units, there isn't any file. When I use mocha to run this path, it throws can't resolve path, but glob(path) returns []. Maybe, it shouldn't throw error.

tests/
    units/
        lib-test.js

If directory structure likes above, it works well.

Review on Reviewable

@danielstjules
Copy link
Contributor

Thanks for the PR! How are you invoking mocha given the dir structure above to trigger the exception?

@mariodu
Copy link
Author

mariodu commented Dec 27, 2015

like:

mocha --reporter spec --recursive --growl -t 0 ./test/units/*-test.js

@dasilvacontin
Copy link
Contributor

This also happens when you invoke mocha without specifying folder / files, and there's no test folder, or there are no files under the folder. It's a common case when starting a new project using a boilerplate, and you don't want to bother with tests just yet because you're experimenting and changing how things work very fast.

@hollomancer hollomancer added the status: needs review a maintainer should (re-)review this pull request label Aug 28, 2016
@knownasilya
Copy link

knownasilya commented Sep 23, 2016

Can this be rebased and merged?

@Munter
Copy link
Contributor

Munter commented Sep 23, 2016

I think #2450 already covers this case

@knownasilya
Copy link

Is that in the latest version?

@Munter
Copy link
Contributor

Munter commented Sep 24, 2016

I don't think a release has been made yet. It just got merged into master

@boneskull
Copy link
Contributor

@Munter should this be closed? if so, please do

@Munter
Copy link
Contributor

Munter commented Nov 24, 2016

I think it should. If I'm wrong and this error case is not covered by #2450 then please reopen

@Munter Munter closed this Nov 24, 2016
@boneskull boneskull removed the status: needs review a maintainer should (re-)review this pull request label Dec 12, 2017
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

Successfully merging this pull request may close these issues.

7 participants