Replies: 2 comments 1 reply
-
Heya @asiliuk! Thanks for the feedback. My apologies for missing this until now. We have documentation on using nimble without xctest. It's a bit of a clunky setup, to be sure. And it doesn't solve your issue with I did just try Let me know if it works for you! |
Beta Was this translation helpful? Give feedback.
-
Hey @younata! Thanks for the response and opening PR!
Here's simple swift package that could reproduce this problem. I've tried with and without build post-action it does not solve the issue I've experimented on local Nimble copy and used https://github.com/pointfreeco/xctest-dynamic-overlay and it solved this problem I don't understand why it still tries to import XCTest despite Thanks for spending your time on this! |
Beta Was this translation helpful? Give feedback.
-
The only file that imports
XCTest
isNimbleXCTestHandler
and it makes it impossible to useNimble
outside of the test targets or targets that are only imported by tests.When application is split in feature modules it is very handy to declare custom feature related predicates nearby the feature code. For example in Analytics module it could be nice to declare predicates that simplify assertions
To do so it needs to be able
import Nimble
. So this function should either live inAnalyticsLibraryTests
that makes it impossible to reuse it in any other test module. Or it should be declared in new moduleAnalyticsLibraryTestUtils
that could only be imported by test modules.Going the way
<Module>TestUtils
is not most convenient thing to do. First it results in x2 number of modules. And second it result in a lot of issues with linking. One example is when such module is linked to application test target that links tohost
application. In such caseAnalyticsLibrary
is linked twice, once by application module and once by test module throughAnalyticsLibraryTestUtils
.So my question is: Have you considered a possibility to remove dependency on
XCTest
so predicate code could be declared in feature module?#if canImport(XCTest)
but I'm not sure what side effects such approach will haveBeta Was this translation helpful? Give feedback.
All reactions