guard
will be triggered, and file not loaded, what can I do?
final class IkigaJSONTests: XCTestCase {
func testConst() {
guard let filepath = Bundle.main.path(forResource: "const", ofType: "json"), let schemaStr = try? String(contentsOfFile: filepath) else { // <-------
XCTFail()
return
}
file is added:
Tried this, did not work: How to include a file in Test Bundle swift?
Here, this also not good, and when adding not Xcode does not ask to add to bundle
func testConst() {
let bundle = Bundle(for: IkigaJSONTests.self)
guard let filepath = bundle.path(forResource: "const", ofType: "json"), let schemaStr = try? String(contentsOfFile: filepath) else {
XCTFail()