Contents

expect(_:sourceLocation:performing:throws:)

Check that an expression always throws an error matching some condition.

Declaration

@discardableResult @freestanding(expression) macro expect<R>(_ comment: @autoclosure () -> Comment? = nil, sourceLocation: SourceLocation = #_sourceLocation, performing expression: () async throws -> R, throws errorMatcher: (any Error) async throws -> Bool) -> (any Error)?

See Also

Checking that errors are thrown