Skip to content

Conversation

@Briantmorr
Copy link
Contributor

@Briantmorr Briantmorr commented Mar 28, 2018

This pull request fixes #1750, a need for better documenting of ignore patterns . Before creating this issue user vjpr was unable to find documention on this issue with keyword searches. I added a simple explanation using the words 'ignore' and 'exclude' so that users unsure how to ignore tests will also be more likely to find my explanation in keyword searches.
I also changed not-this-file.js to exclude-this-file.js to provide a clearer example to users reading the documentation.

…ble. Also used 'ignore' and 'exclude' keywords to help users stuck on this issue find it easier.
"files": [
"my-test-folder/*.js",
"!**/not-this-file.js"
"!**/exclude-this-file.js"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Briantmorr, you should also add an example of ignoring a directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seconded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will do!

Copy link
Member

@novemberborn novemberborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping out with this @Briantmorr. Could you add the directory-ignoring example @clemtrek mentioned?

"files": [
"my-test-folder/*.js",
"!**/not-this-file.js"
"!**/exclude-this-file.js"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seconded.

@sindresorhus sindresorhus changed the title Documented how to exclude a directory of test in readme > configuration (issue #1750) Document how to exclude a directory Apr 2, 2018
@Briantmorr
Copy link
Contributor Author

I pushed again with updated changes. Minor semantic detail, I changed the word 'folder' to directory for clarity.

@ghost
Copy link

ghost commented Apr 3, 2018

@Briantmorr orr, I would prefer directory.

Any thoughts on this @novemberborn

@novemberborn
Copy link
Member

👍 on directory, good call @Briantmorr.

These examples aren't quite right though. Once you customize files, you lose the default behavior:

  • "my-test-directory/*.js": Only run test files inside my-test-directory
  • "!exclude-this-directory/*.js": Doesn't do anything, since exclude-this-directory is never included in the first place
  • "!**/exclude-this-file.js": Does exclude my-test-directory/exclude-this-file.js

I think it might be better if the first example is my-test-directory/**/*.js and the second !my-test-directory/exclude-this-directory/**/*.js. What do you think?

@Briantmorr
Copy link
Contributor Author

Thanks for taking the time to explain @novemberborn . I greatly appreciate it! I just updated with your suggested changes!

@novemberborn novemberborn merged commit a510088 into avajs:master Apr 8, 2018
@novemberborn
Copy link
Member

Thanks @Briantmorr!

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.

Document how to exclude a directory of tests

2 participants