-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support more test filename conventions #721
Support more test filename conventions #721
Conversation
Wait for #713 to land. Then check |
@@ -80,7 +80,7 @@ var cli = meow([ | |||
' ava --init foo.js', | |||
'', | |||
'Default patterns when no arguments:', | |||
'test.js test-*.js test/**/*.js' | |||
'test.js test-*.js test/**/*.js __tests__/**/*.js **/*.test.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the convention is that __tests__
can be anywhere? Hence why it's wrapped in underscores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, is my glob wrong? Should it be **/__tests__/**
? That's what I did for my PR to nyc
. Forgive my ignorance with glob
😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 **/__tests__/**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. 👍 I've subscribed to #713. As soon as that gets merged, I'll give this another look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not __tests__/**/*.js
?
|
7048016
to
1271010
Compare
This has been updated 👍 |
@@ -17,7 +17,9 @@ function defaultIncludePatterns() { | |||
return [ | |||
'test.js', | |||
'test-*.js', | |||
'test' | |||
'test', | |||
'**/__tests__/**', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all **/*.js
files inside __tests__
tests? If so I think you just need to match **/__tests__
and AVA's built in directory recursion will take over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
I imagine that we'll want to add a test for this, but I can't seem to find existing tests for the default inclusion glob... |
Yea. I'm alluding to that in #736. |
@@ -80,7 +80,7 @@ var cli = meow([ | |||
' ava --init foo.js', | |||
'', | |||
'Default patterns when no arguments:', | |||
'test.js test-*.js test/**/*.js' | |||
'test.js test-*.js test/**/*.js **/__tests__ **/*.test.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation wise it should be **/__tests__/**/*.js
, just like the test
directory in ava-files
is explained as test/**/*.js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Updated 👍
LGTM! |
Woohoo! This makes my day, thanks @kentcdodds! |
This PR just updates documentation. I couldn't for the life of me find out where this magic happens. Pointers? Thanks!