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

File name matching glob pattern #384

Closed
walling opened this issue Jun 25, 2015 · 5 comments
Closed

File name matching glob pattern #384

walling opened this issue Jun 25, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@walling
Copy link

@walling walling commented Jun 25, 2015

With nested folders for your code, it is sometimes nice to make your test files be along the production code, fx. my-route-test.js accompanying my-route.js. I would basically love to have an option for matching file patterns like this:

lab -P src/**/*-test.js

Is it on the roadmap?

@walling

This comment has been minimized.

Copy link
Author

@walling walling commented Jun 25, 2015

Looking at cli.js:329-331 it might not be super easy to implement. I would also be happy with just matching filename (without extension), like so:

lab -P *-test src  # Running in src/ directory and looking for files named *-test.js

This way the extension overwrite system can be kept. I think it would be a minor change.

@geek geek added the feature label Jul 5, 2015
@geek geek self-assigned this Jul 5, 2015
@geek geek added this to the 5.13.0 milestone Jul 5, 2015
@geek geek closed this in #395 Jul 5, 2015
@kidtronnix

This comment has been minimized.

Copy link

@kidtronnix kidtronnix commented Aug 15, 2015

Hey any chance of how to implement this enhancement? I can't get this to work with.

$ lab --pattern **/*_test.js

My test files are not located in a test folder.

@gergoerdosi

This comment has been minimized.

Copy link
Contributor

@gergoerdosi gergoerdosi commented Aug 15, 2015

Here is an example: lab --pattern '_test' src. This command will look for files ending with _test.js in the src directory.

@kidtronnix

This comment has been minimized.

Copy link

@kidtronnix kidtronnix commented Aug 15, 2015

Thank you!

Yeah I was struggling to make it look in any sub directory as my tests are next to the source code they are testing, but everything is located in two sub directories so i think i could make it work.

Is there an easy way to get lab to look in all folders?

@gergoerdosi

This comment has been minimized.

Copy link
Contributor

@gergoerdosi gergoerdosi commented Aug 15, 2015

If those directories don't change, you can just specify two directories:

lab --pattern '_test' api web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.