When running a unit test without a host application, my code for creating a file is returning something in the CoreSimulator. However that location doesn't necessarily exist.
This is my code:
let searchPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let documentFolderPath = searchPaths[0]
let dbFilePath = documentFolderPath + "/test.db"
dbFilePath created:
/Users/aaronbratcher/Library/Developer/CoreSimulator/Devices/3E6F7BD3-482B-4A90-B3C7-C0CC8412A5AC/data/Documents/test.db
How can I get a path outside of CoreSimulator when running unit tests without a host app?