@@ -227,7 +227,14 @@ final class WorkflowRenderTesterFailureTests: XCTestCase {
227
227
rendering. doNoopAction ( 10 )
228
228
}
229
229
230
- expectingFailure ( #"("noop(10)") is not equal to ("noop(70)")"# ) {
230
+ expectingFailure ( """
231
+ failed - XCTAssertNoDifference failed: …
232
+
233
+ − TestAction.noop(10)
234
+ + TestAction.noop(70)
235
+
236
+ (First: −, Second: +) - Action (First) does not match the expected action (Second)
237
+ """ ) {
231
238
result. assert ( action: TestAction . noop ( 70 ) )
232
239
}
233
240
@@ -272,7 +279,14 @@ final class WorkflowRenderTesterFailureTests: XCTestCase {
272
279
}
273
280
}
274
281
275
- expectingFailure ( #"("sendOutput("second")") is not equal to ("noop(0)")"# ) {
282
+ expectingFailure ( """
283
+ failed - XCTAssertNoDifference failed: …
284
+
285
+ − TestAction.sendOutput( " second " )
286
+ + TestAction.noop(0)
287
+
288
+ (First: −, Second: +) - Action (First) does not match the expected action (Second)
289
+ """ ) {
276
290
result. assert ( action: TestAction . noop ( 0 ) )
277
291
}
278
292
@@ -296,7 +310,14 @@ final class WorkflowRenderTesterFailureTests: XCTestCase {
296
310
rendering. doOutput ( " hello " )
297
311
}
298
312
299
- expectingFailure ( #"("string("hello")") is not equal to ("string("nope")")"# ) {
313
+ expectingFailure ( """
314
+ failed - XCTAssertNoDifference failed: …
315
+
316
+ − TestWorkflow.Output.string( " hello " )
317
+ + TestWorkflow.Output.string( " nope " )
318
+
319
+ (First: −, Second: +) - Output (First) does not match the expected output (Second)
320
+ """ ) {
300
321
result. assert ( output: . string( " nope " ) )
301
322
}
302
323
@@ -341,12 +362,36 @@ final class WorkflowRenderTesterFailureTests: XCTestCase {
341
362
}
342
363
}
343
364
365
+ func test_assertState( ) {
366
+ let result = TestWorkflow ( )
367
+ . renderTester ( initialState: . idle)
368
+ . render { _ in }
369
+
370
+ expectingFailure ( """
371
+ failed - XCTAssertNoDifference failed: …
372
+
373
+ − TestWorkflow.State.idle
374
+ + TestWorkflow.State.sideEffect(key: " nah " )
375
+
376
+ (First: −, Second: +) - State (First) does not match the expected state (Second)
377
+ """ ) {
378
+ result. assert ( state: TestWorkflow . State. sideEffect ( key: " nah " ) )
379
+ }
380
+ }
381
+
344
382
func test_assertStateModifications( ) {
345
383
let result = TestWorkflow ( )
346
384
. renderTester ( initialState: . idle)
347
385
. render { _ in }
348
386
349
- expectingFailure ( " Expected state does not match " ) {
387
+ expectingFailure ( """
388
+ XCTAssertNoDifference failed: …
389
+
390
+ − TestWorkflow.State.idle
391
+ + TestWorkflow.State.sideEffect(key: " nah " )
392
+
393
+ (First: −, Second: +) - State (First) does not match the expected state (Second)
394
+ """ ) {
350
395
result. assertStateModifications { state in
351
396
state = . sideEffect( key: " nah " )
352
397
}
0 commit comments