-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added the implementation logic to create Plugin tests alongside a plugin #580
Conversation
…Tests.stencil Co-authored-by: Christopher Fuller <[email protected]>
…Tests.stencil Co-authored-by: Christopher Fuller <[email protected]>
Tests/NodesXcodeTemplatesGeneratorTests/StencilRendererTests.swift
Outdated
Show resolved
Hide resolved
Tests/NodesXcodeTemplatesGeneratorTests/StencilRendererTests.swift
Outdated
Show resolved
Hide resolved
# Conflicts: # Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil
Tests/NodesXcodeTemplatesGeneratorTests/Support/TestFactories.swift
Outdated
Show resolved
Hide resolved
Tests/NodesXcodeTemplatesGeneratorTests/Support/TestFactories.swift
Outdated
Show resolved
Hide resolved
…swift Co-authored-by: Garric Nahapetian <[email protected]>
…swift Co-authored-by: Garric Nahapetian <[email protected]>
* Added a tests template for Plugin * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Christopher Fuller <[email protected]> * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Christopher Fuller <[email protected]> * Added override test * addressing comments * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Christopher Fuller <[email protected]> * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Garric Nahapetian <[email protected]> * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Christopher Fuller <[email protected]> * Update Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil Co-authored-by: Christopher Fuller <[email protected]> --------- Co-authored-by: Christopher Fuller <[email protected]> Co-authored-by: Garric Nahapetian <[email protected]>
Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil
Show resolved
Hide resolved
Sources/NodesXcodeTemplatesGenerator/XcodeTemplates/PluginNodeXcodeTemplate.swift
Outdated
Show resolved
Hide resolved
@@ -21,13 +21,16 @@ internal struct PluginXcodeTemplate: XcodeTemplate { | |||
|
|||
internal init(config: Config) { | |||
let plugin: StencilTemplate = .plugin | |||
stencils = [plugin] | |||
let pluginTests: StencilTemplate = .pluginTests | |||
stencils = config.isTestTemplatesGenerationEnabled ? [plugin, pluginTests] : [plugin] |
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.
Can this be done this way so plugin
is only referenced one time?
stencils = config.isTestTemplatesGenerationEnabled ? [plugin, pluginTests] : [plugin] | |
stencils = [plugin] + config.isTestTemplatesGenerationEnabled ? [pluginTests] : [] |
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.
see above
Tests/NodesXcodeTemplatesGeneratorTests/StencilRendererTests.swift
Outdated
Show resolved
Hide resolved
Tests/NodesXcodeTemplatesGeneratorTests/StencilRendererTests.swift
Outdated
Show resolved
Hide resolved
Looking great, Sam. Please manually test these changes using the Quick Start. Please test with |
…Tests.stencil Co-authored-by: Garric Nahapetian <[email protected]>
…wift Co-authored-by: Christopher Fuller <[email protected]>
…wift Co-authored-by: Christopher Fuller <[email protected]>
…XcodeTemplate.swift Co-authored-by: Christopher Fuller <[email protected]>
@tinder-garricnahapetian tested both implementation in a Quickstart. Looking good |
This adds the logic to create PluginTests.swift along side a plugin. We use the same boolean in config to toggle on and off the plugin tests.