mirror of
https://github.com/codybrom/blankie.git
synced 2026-05-14 07:40:35 +00:00
0d17ec9923
feat(tests): Implement async XCTestCase extension for handling asynchronous operations feat(audio): Enhance Sound class with public access and loadSound method feat(settings): Update GlobalSettings methods to use @MainActor for thread safety
22 lines
427 B
Swift
22 lines
427 B
Swift
//
|
|
// XCTestCase+Async.swift
|
|
// Blankie
|
|
//
|
|
// Created by Cody Bromley on 1/10/25.
|
|
//
|
|
|
|
import XCTest
|
|
|
|
extension XCTestCase {
|
|
func waitForAsync(timeout: TimeInterval = 1.0, completion: @escaping () async -> Void) async {
|
|
let expectation = expectation(description: "Async operation")
|
|
|
|
Task {
|
|
await completion()
|
|
expectation.fulfill()
|
|
}
|
|
|
|
await fulfillment(of: [expectation], timeout: timeout)
|
|
}
|
|
}
|