Files
blankie/BlankieTests/XCTestCase+Async.swift
Cody Bromley 0d17ec9923 feat(tests): Add unit tests for AudioManager, PresetManager, and Sound classes
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
2025-01-10 22:32:32 -06:00

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)
}
}