Closed markst closed 1 year ago
Appears that mainTarget
is incorrectly resolving to my test target.
Strange when it seems to be: context.package.targets.first
Hello! Yes, you are right. I can use your fix and make a pull request, or you can create pull request it yourself (since you already fixed the problem). 😊
I think the problem is adding the plugin for tests not in the test target.
.testTarget(
name: "SnapshotTests",
dependencies: [
"ModuleTypes",
.product(name: "TestAssets", package: "Asset"),
.product(name: "SnapshotTesting", package: "swift-snapshot-testing")
],
plugins: [
// For Snapshot Tests
.plugin(name: "PrefireTestsPlugin", package: "Prefire")
]
)
But still, I added some checks to get the mainTarget
https://github.com/BarredEwe/Prefire/pull/14
Think you may be right @BarredEwe - I'll have another go. Still right to not assume targets.first
is main target.
I think, filtering your own target name (this fix was added in the latest release) and connecting the plugin to testTarget can fix this problem. @markst Could you try the latest release?
Swift package: