3

1.Does watchOS (as of watchOS 4.3) currently support unit or UI testing? There is no UI Test Case Class file and Unit Test Case Class file in the watchOS file.

2.If watchOS supports unit testing, can we place the Unit Test Case file of watchOS in the iOS Unit Test Case file?

Jordan H
  • 52,571
  • 37
  • 201
  • 351
White wu
  • 95
  • 1
  • 8

1 Answers1

0

This has been added to Xcode 12.5 otherwise your best bet is modularize and refactor your code into Swift Packages and test them that way. There's a lot of code in your application which doesn't require watchOS (unless it's UI Testing of course).

Here's a great post by Jason Zurita about he does this and it's the approach I use as well: https://jasonzurita.com/automated-testing-for-watchos-apps/

I also explain some of the process here with my app Heartwitch: https://youtu.be/fzLkHAku1mc?t=1723

leogdion
  • 2,332
  • 1
  • 19
  • 21