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

Broaden the test regex #2

Closed
wants to merge 1 commit into from

Conversation

brianmhunt
Copy link

Not everyone stores files in a tests? path e.g. some folks classify them with *.test.coffee or *.spec.coffee.

Not everyone stores files in a `tests?` path e.g. some folks classify them with `*.test.coffee` or `*.spec.coffee`.
Copy link
Owner

@danielbayley danielbayley left a comment

Choose a reason for hiding this comment

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

@brianmhunt What about something like [^\\s/]*(test|spec).*\\.(#{glob})$

@@ -6,7 +6,7 @@ task 'generate', "Generate Jest preset JSON config.", =>
preset =
moduleFileExtensions: [ 'js', 'json', coffee... ]
transform: "#{glob}": process.env.npm_package_name
testRegex: "tests?/.*\\.(#{glob})$"
testRegex: "(tests?)?/.*\\.(#{glob})$"
Copy link
Owner

@danielbayley danielbayley Apr 12, 2019

Choose a reason for hiding this comment

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

@brianmhunt Thanks! But for this to work, wouldn't the / also need to be included in the optional part of the regex though? Something more like (tests?/)?.*\\.(#{glob})$… have you tested it?

Copy link
Author

Choose a reason for hiding this comment

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

Could be. I’m not using coffeescript on any projects right now so I’m not set up to test it, I’m afraid. Because I can’t easily assist I won’t mind if you close - if you want to clean up the project issues. Can always reopen if others (or future me) come along want it.

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.

2 participants