Skip to content

Allow nodeunit to run tests in a dir and recursively inside its child dirs#54

Closed
aurium wants to merge 1 commit intocaolan:masterfrom
aurium:master
Closed

Allow nodeunit to run tests in a dir and recursively inside its child dirs#54
aurium wants to merge 1 commit intocaolan:masterfrom
aurium:master

Conversation

@aurium
Copy link

@aurium aurium commented Jan 27, 2011

I'm using nodeunit in a project and i'm very happy with it, but my collection of test modules is going to be enough big to convince me to organize then in sub-directories. I start to do this, but i discover that "nodeunit test" command will not to run tests inside "test/helpers" or "test/models", so i made a patch to make util.modulePaths() to get it recursively to nodeunit.runFiles().

I don't see why not to work recursively, so i think that is the better default action.

I also made it with synchronous fileSystem methods because the testing action is not paralleled and the asynchronous code to do this is crazily more complex. :-)

@caolan
Copy link
Owner

caolan commented Feb 2, 2011

I think this is a good idea, but should include 2 changes:

  1. This should be made an option (-r perhaps) since we might break existing test suites by running fixtures directories etc.
  2. Nodeunit makes use of the async library which will help with the complexity of reading directories asynchronously, so we should remove the sync call - I can help with this

Hopefully these changes would be acceptable?
When I get some time to work on this I can make these changes and merge this in.

Thanks again for your contribution :)

@aurium
Copy link
Author

aurium commented Feb 3, 2011

Thank you!
And i see, i will learn when i see the result code with your adaptation. :-)

@Sannis
Copy link
Contributor

Sannis commented Sep 20, 2011

I hope I will help with this issue in next week.

Maybe we can use nopt to parse arguments? It installs with npm, so it does not be a problem for node users.

@mreinstein
Copy link
Collaborator

@aurium I think this is a good patch. Can you please update your patch and resubmit? It doesn't merge cleanly.

@achingbrain
Copy link

It would be rather good if something like this made it in. I frequently find myself arranging tests in subdirectories that mirrors the code they are testing and then being unable to run all the tests in one go without having some sort of test aggregator.

@groe
Copy link

groe commented Dec 21, 2013

+1

8 similar comments
@mariansollmann
Copy link

👍

@rpaterson
Copy link

+1

@jarrettchisholm
Copy link

+1

@bud-mo
Copy link

bud-mo commented Nov 12, 2014

+1

@alexgandy
Copy link

+1

@Petah
Copy link

Petah commented Jul 25, 2015

+1

@zoejobson
Copy link

+1

@terodox
Copy link

terodox commented Jul 14, 2016

+1

@mreinstein
Copy link
Collaborator

Sorry for the incredibly long reply delay!

I think #308 is a good solution. Waiting for the re-submission of the PR which merges cleanly and includes tests.

@mreinstein
Copy link
Collaborator

resolved via #308

@mreinstein mreinstein closed this Aug 30, 2016
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.