@@ -112,63 +112,6 @@ final class RuntimeWarningTests: XCTestCase {
112112 _ = XCTWaiter . wait ( for: [ . init( ) ] , timeout: 2 )
113113 }
114114
115- func testEffectEmitMainThread( ) {
116- XCTExpectFailure {
117- [
118- """
119- An effect completed on a non-main thread. …
120-
121- Effect returned from:
122- Action.response
123-
124- Make sure to use " .receive(on:) " on any effects that execute on background threads to \
125- receive their output on the main thread.
126-
127- The " Store " class is not thread-safe, and so all interactions with an instance of " Store " \
128- (including all of its scopes and derived view stores) must be done on the main thread.
129- """ ,
130- """
131- An effect published an action on a non-main thread. …
132-
133- Effect published:
134- Action.response
135-
136- Effect returned from:
137- Action.tap
138-
139- Make sure to use " .receive(on:) " on any effects that execute on background threads to \
140- receive their output on the main thread.
141-
142- The " Store " class is not thread-safe, and so all interactions with an instance of " Store " \
143- (including all of its scopes and derived view stores) must be done on the main thread.
144- """ ,
145- ]
146- . contains ( $0. compactDescription)
147- }
148-
149- enum Action { case tap, response }
150- let store = Store (
151- initialState: 0 ,
152- reducer: Reducer< Int, Action, Void> { state, action, _ in
153- switch action {
154- case . tap:
155- return . run { subscriber in
156- Thread . detachNewThread {
157- XCTAssertFalse ( Thread . isMainThread, " Effect should send on non-main thread. " )
158- subscriber. send ( . response)
159- }
160- return AnyCancellable { }
161- }
162- case . response:
163- return . none
164- }
165- } ,
166- environment: ( )
167- )
168- ViewStore ( store) . send ( . tap)
169- _ = XCTWaiter . wait ( for: [ . init( ) ] , timeout: 4 )
170- }
171-
172115 func testBindingUnhandledAction( ) {
173116 struct State : Equatable {
174117 @BindableState var value = 0
0 commit comments