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