-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pod support for test blueprints #2472
Conversation
Added a Changelog entry. |
👍 |
LGTM @jgwhite - Would you mind reviewing? |
@return {Boolean} | ||
*/ | ||
function isTestFile(file) { | ||
return file.match(/-test/); |
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.
Should we anchor this to the end of the filename /-test\.js$/
just to be on the safe side?
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.
We would need to use path.extname
and tack that on the end of the regexp (to support .coffee
and other formats).
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.
Doh, I probably should have named that better, it changed from the original intent of checking against the files. I'm actually only checking the blueprint name for /-test/
, not the files in the blueprint.
I'll probably remove it and just do the match in place.
One very minor comment but seems rad apart from that. |
@@ -507,12 +507,20 @@ Blueprint.prototype._fileMapTokens = function(options) { | |||
return options.dasherizedModuleName; | |||
}, | |||
__path__: function(options) { | |||
var blueprintName = options.blueprintName; | |||
|
|||
if(blueprintName.match(/-test/)) { |
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 am now just using match against the blueprintName. isTestFile
was no longer used or necessary, so I removed it.
needs a rebase |
Something went sideways in the rebase. Working on it. |
Pod support for test blueprints
This PR adds
--pod
support for tests generated from blueprints as requested in issue #2414. Test blueprints for blueprints that support pods now have a__path__
token for the containing folder. The__path__
token now has some logic that determines if the blueprint name contains-test
and adjusts accordingly.A generated test is created in the following structure: