@@ -178,14 +178,35 @@ public struct Configuration: Sendable {
178
178
179
179
// MARK: - Event handling
180
180
181
- /// Whether or not events of the kind
182
- /// ``Event/Kind-swift.enum/expectationChecked(_:)`` should be delivered to
183
- /// this configuration's ``eventHandler`` closure.
181
+ /// A type describing options to use when delivering events to this
182
+ /// configuration's event handler
183
+ public struct EventHandlingOptions : Sendable {
184
+ /// Whether or not events of the kind ``Event/Kind-swift.enum/issueRecorded(_:)``
185
+ /// containing issues with warning (or lower) severity should be delivered
186
+ /// to the event handler of the configuration these options are applied to.
187
+ ///
188
+ /// By default, events matching this criteria are delivered to event
189
+ /// handlers unless the entry point specifies an event stream version which
190
+ /// predates the introduction of warning issues, in which case this is
191
+ /// disabled to maintain legacy behavior.
192
+ public var isWarningIssueEventDeliveryEnabled : Bool = true
193
+
194
+ /// Whether or not events of the kind
195
+ /// ``Event/Kind-swift.enum/expectationChecked(_:)`` should be delivered to
196
+ /// the event handler of the configuration these options are applied to.
197
+ ///
198
+ /// By default, events of this kind are not delivered to event handlers
199
+ /// because they occur frequently in a typical test run and can generate
200
+ /// significant back-pressure on the event handler.
201
+ public var isExpectationCheckedEventDeliveryEnabled : Bool = false
202
+ }
203
+
204
+ /// The options to use when delivering events to this configuration's event
205
+ /// handler.
184
206
///
185
- /// By default, events of this kind are not delivered to event handlers
186
- /// because they occur frequently in a typical test run and can generate
187
- /// significant backpressure on the event handler.
188
- public var deliverExpectationCheckedEvents = false
207
+ /// The default value of this property is an instance of ``EventHandlingOptions-swift.struct``
208
+ /// with its properties initialized to their default values.
209
+ public var eventHandlingOptions : EventHandlingOptions = . init( )
189
210
190
211
/// The event handler to which events should be passed when they occur.
191
212
public var eventHandler : Event . Handler = { _, _ in }
@@ -325,4 +346,14 @@ extension Configuration {
325
346
}
326
347
}
327
348
#endif
349
+
350
+ @available ( * , deprecated, message: " Set eventHandlingOptions.isExpectationCheckedEventDeliveryEnabled instead. " )
351
+ public var deliverExpectationCheckedEvents : Bool {
352
+ get {
353
+ eventHandlingOptions. isExpectationCheckedEventDeliveryEnabled
354
+ }
355
+ set {
356
+ eventHandlingOptions. isExpectationCheckedEventDeliveryEnabled = newValue
357
+ }
358
+ }
328
359
}
0 commit comments