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

Add NodesTesting import to test stencils #835

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/NodesGenerator/StencilTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public enum StencilTemplate: CustomStringConvertible, Equatable, Sendable {
.union(config.reactiveImports)
case .contextTests:
config.baseTestImports
.union(uiFramework == nil ? [] : ["NodesTesting"])
case .flow:
config.baseImports
.union(["Nodes"])
Expand Down Expand Up @@ -277,7 +278,7 @@ public enum StencilTemplate: CustomStringConvertible, Equatable, Sendable {
.union(uiFramework.flatMap { [$0.import] } ?? [])
case .viewControllerTests:
uiFramework == nil ? [] : config.baseTestImports
.union(config.reactiveImports)
.union(uiFramework?.kind.isHostingSwiftUI == true ? ["NodesTesting"] : config.reactiveImports)
case .viewState:
uiFramework == nil ? [] : config.baseImports
.union(["Nodes"])
Expand Down
5 changes: 3 additions & 2 deletions Tests/NodesGeneratorTests/StencilTemplateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ final class StencilTemplateTests: XCTestCase, TestFactories {
]
case .contextTests:
expect(imports) == [
"<baseTestImport>"
"<baseTestImport>",
"NodesTesting"
]
case .flow:
expect(imports) == [
Expand Down Expand Up @@ -345,7 +346,7 @@ final class StencilTemplateTests: XCTestCase, TestFactories {
case .viewControllerTests:
expect(imports) == [
"<baseTestImport>",
"<reactiveImport>"
uiFramework.kind.isHostingSwiftUI ? "NodesTesting" : "<reactiveImport>"
]
case .viewState:
expect(imports) == [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ContextTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#warning("Manually move this test file to the corresponding test target then delete this warning.")

import Combine
import Nimble
import NodesTesting
import XCTest

final class ___VARIABLE_productName___ViewControllerTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down Expand Up @@ -86,7 +87,7 @@
- viewControllerSuperParameters: ""
▿ viewControllerTestsImports: 2 elements
- "<baseTestImport>"
- "<reactiveImport>"
- "NodesTesting"
- viewControllerType: "NSHostingController"
- viewControllerUpdateComment: "<viewControllerUpdateComment>"
- viewStateEmptyFactory: "<viewStateEmptyFactory>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down Expand Up @@ -86,7 +87,7 @@
- viewControllerSuperParameters: ""
▿ viewControllerTestsImports: 2 elements
- "<baseTestImport>"
- "<reactiveImport>"
- "NodesTesting"
- viewControllerType: "NSHostingController"
- viewControllerUpdateComment: "<viewControllerUpdateComment>"
- viewStateEmptyFactory: "<viewStateEmptyFactory>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down Expand Up @@ -86,7 +87,7 @@
- viewControllerSuperParameters: ""
▿ viewControllerTestsImports: 2 elements
- "<baseTestImport>"
- "<reactiveImport>"
- "NodesTesting"
- viewControllerType: "UIHostingController"
- viewControllerUpdateComment: "<viewControllerUpdateComment>"
- viewStateEmptyFactory: "<viewStateEmptyFactory>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
- "<baseImport>"
- "<reactiveImport>"
- "Nodes"
▿ contextTestsImports: 1 element
▿ contextTestsImports: 2 elements
- "<baseTestImport>"
- "NodesTesting"
▿ dependencies: 1 element
▿ 2 key/value pairs
▿ (2 elements)
Expand Down Expand Up @@ -86,7 +87,7 @@
- viewControllerSuperParameters: ""
▿ viewControllerTestsImports: 2 elements
- "<baseTestImport>"
- "<reactiveImport>"
- "NodesTesting"
- viewControllerType: "UIHostingController"
- viewControllerUpdateComment: "<viewControllerUpdateComment>"
- viewStateEmptyFactory: "<viewStateEmptyFactory>"
Expand Down
Loading