I've noticed recently that @testable import
doesn't seem to work for Watch Extension modules.
Here's what I've tried so far:
- Create a new Xcode project with WatchKit app and include unit tests.
- Open the auto created unit tests file and add
@testable import ProjectName_WatchKit_Extension
(after confirming that this is the correct module name in the extension's build settings). This gives a 'no such module' compiler error. - Confirm that 'Enable testability' is set to yes in Extension build settings.
- Change name of Extension module to remove spaces
I am of course able to successfully unit test by adding the required files to the test target, but it feels like this should not be necessary.
Has anyone been able to successfully use @testable import
with a Watch Extension? Is this something I should be able to do? Any help would be much appreciated.