Allow unit-testing in SPM builds

This commit is contained in:
John Estropia
2022-08-16 11:55:44 +08:00
parent da4ac192db
commit 7f4cfaf5a0
5 changed files with 30 additions and 16 deletions

View File

@@ -28,6 +28,17 @@ import XCTest
@testable
import CoreStore
#if !SWIFT_PACKAGE
extension Bundle {
static var module: Bundle {
return Bundle(for: BaseTestCase.self)
}
}
#endif
// MARK: - BaseTestCase
@@ -40,7 +51,7 @@ class BaseTestCase: XCTestCase {
let stack = DataStack(
xcodeModelName: "Model",
bundle: Bundle(for: Self.self)
bundle: Bundle.module
)
do {