Skip to content

Instantly share code, notes, and snippets.

import Foundation
private let log = Log(topic: .rateLimit)
/// Timeout based rate limit helper class.
final class RateLimit {
// MARK: - Private
private let timeout: TimeInterval
extension XCTestCase {
enum FixtureError: Error {
case resourceNotFound
case invalidFormat
}
/// Loads the json fixture with the given name from disk and returns a json object.
/// - Parameter fileName: The anme of the fixture on disk (without the type suffix).
/// - Throws: Any errors encountered during the process.
extension XCTestCase {
struct AwaitError: Error {}
/**
This function is useful for asynchronous testing and acts as a wrapper around test expectations.
Consider the following example:
```swift
// Let's asume we have an async function with the following signature: