Skip to content

Commit

Permalink
[feat] #144 Feature testTarget 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
stealmh committed Oct 15, 2024
1 parent f6c7f98 commit 61aeadd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Projects/Feature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ let demoTargets = Feature.allCases.map { feature in
return feature.demoTarget
}

let testTargets = Feature.allCases.map { feature in
return feature.testTarget
}

let project = Project(
name: "Feature",
targets: targets + demoTargets
targets: targets + demoTargets + testTargets
)
13 changes: 13 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Feature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ public enum Feature: String, CaseIterable {
]
)
}

public var testTarget: Target {
return .makeTarget(
name: "Feature\(self.rawValue)Tests",
product: .unitTests,
bundleName: "Feature.\(self.rawValue)Tests",
infoPlist: .dictionary(["ENABLE_TESTING_SEARCH_PATHS": "YES"]),
resources: ["Feature\(self.rawValue)Tests/Resources/**"],
dependencies: [
.target(self.target)
]
)
}
}

0 comments on commit 61aeadd

Please sign in to comment.