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

Added the implementation logic to create Plugin tests alongside a plugin #580

Merged
merged 24 commits into from
Feb 9, 2024

Conversation

tinder-SamMarshall
Copy link
Contributor

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.

Base automatically changed from feature/plugin-test-template to main January 9, 2024 19:24
# Conflicts:
#	Sources/NodesXcodeTemplatesGenerator/Resources/Stencils/PluginTests.stencil
@tinder-cfuller tinder-cfuller added generator Generator and removed templates Templates labels Jan 13, 2024
* 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]>
@@ -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]
Copy link
Collaborator

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?

Suggested change
stencils = config.isTestTemplatesGenerationEnabled ? [plugin, pluginTests] : [plugin]
stencils = [plugin] + config.isTestTemplatesGenerationEnabled ? [pluginTests] : []

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above

@tinder-garricnahapetian
Copy link
Contributor

Looking great, Sam. Please manually test these changes using the Quick Start. Please test with pluginTestsImports empty and non-empty and isNimbleEnabled true and false. Thank you :)

@tinder-SamMarshall
Copy link
Contributor Author

@tinder-garricnahapetian tested both implementation in a Quickstart. Looking good
Screenshot 2024-01-25 at 3 58 48 PM

@tinder-cfuller tinder-cfuller merged commit bdf1895 into main Feb 9, 2024
6 checks passed
@tinder-cfuller tinder-cfuller deleted the feature/add-plugin-to-project branch February 9, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants