Skip to content

Commit 8a75b24

Browse files
committed
Small docs fixes.
1 parent 2c40fe0 commit 8a75b24

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Sources/ComposableArchitecture/Documentation.docc/Articles/Testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class CounterTests: XCTestCase {
7474
> Tip: Test cases that use ``TestStore`` should be annotated as `@MainActor` and test methods should
7575
be marked as `async` since most assertion helpers on ``TestStore`` can suspend.
7676

77-
Test stores have a ``TestStore/send(_:_:file:line:)-3pf4p`` method, but it behaves differently from
77+
Test stores have a ``TestStore/send(_:_:file:line:)-6s1gq`` method, but it behaves differently from
7878
stores and view stores. You provide an action to send into the system, but then you must also
7979
provide a trailing closure to describe how the state of the feature changed after sending the
8080
action:
@@ -95,7 +95,7 @@ await store.send(.incrementButtonTapped) {
9595
}
9696
```
9797

98-
> The ``TestStore/send(_:_:file:line:)-3pf4p`` method is `async` for technical reasons that we do
98+
> The ``TestStore/send(_:_:file:line:)-6s1gq`` method is `async` for technical reasons that we do
9999
not have to worry about right now.
100100

101101
If your mutation is incorrect, meaning you perform a mutation that is different from what happened
@@ -146,7 +146,7 @@ await store.send(.decrementButtonTapped) {
146146
> by one, but we haven't proven we know the precise value of `count` at each step of the way.
147147
>
148148
> In general, the less logic you have in the trailing closure of
149-
> ``TestStore/send(_:_:file:line:)-3pf4p``, the stronger your assertion will be. It is best to use
149+
> ``TestStore/send(_:_:file:line:)-6s1gq``, the stronger your assertion will be. It is best to use
150150
> simple, hard coded data for the mutation.
151151
152152
Test stores do expose a ``TestStore/state`` property, which can be useful for performing assertions
@@ -160,7 +160,7 @@ store.send(.incrementButtonTapped) {
160160
XCTAssertTrue(store.state.isPrime)
161161
```
162162
163-
However, when inside the trailing closure of ``TestStore/send(_:_:file:line:)-3pf4p``, the
163+
However, when inside the trailing closure of ``TestStore/send(_:_:file:line:)-6s1gq``, the
164164
``TestStore/state`` property is equal to the state _before_ sending the action, not after. That
165165
prevents you from being able to use an escape hatch to get around needing to actually describe the
166166
state mutation, like so:

Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
### Testing a reducer
1515

16-
- ``send(_:_:file:line:)-3pf4p``
16+
- ``send(_:_:file:line:)-6s1gq``
1717
- ``receive(_:timeout:_:file:line:)``
1818
- ``finish(timeout:file:line:)``
1919
- ``TestStoreTask``
2020

2121
### Accessing state
2222

23-
While the most common way of interacting with a test store's state is via its ``send(_:_:file:line:)-3pf4p`` and ``receive(_:timeout:_:file:line:)`` methods, you may also access it directly throughout a test.
23+
While the most common way of interacting with a test store's state is via its ``send(_:_:file:line:)-6s1gq`` and ``receive(_:timeout:_:file:line:)`` methods, you may also access it directly throughout a test.
2424

2525
- ``state``
2626

Sources/ComposableArchitecture/TestStore.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
220220

221221
/// The current state.
222222
///
223-
/// When read from a trailing closure assertion in ``send(_:_:file:line:)-3pf4p`` or
223+
/// When read from a trailing closure assertion in ``send(_:_:file:line:)-6s1gq`` or
224224
/// ``receive(_:timeout:_:file:line:)``, it will equal the `inout` state passed to the closure.
225225
public var state: State {
226226
self.reducer.state
@@ -229,8 +229,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
229229
/// The timeout to await for in-flight effects.
230230
///
231231
/// This is the default timeout used in all methods that take an optional timeout, such as
232-
/// ``send(_:_:file:line:)-3pf4p``, ``receive(_:timeout:_:file:line:)`` and
233-
/// ``finish(timeout:file:line:)``.
232+
/// ``receive(_:timeout:_:file:line:)`` and ``finish(timeout:file:line:)``.
234233
public var timeout: UInt64
235234

236235
private var _environment: Box<Environment>
@@ -931,7 +930,7 @@ extension TestStore {
931930
}
932931
}
933932

934-
/// The type returned from ``TestStore/send(_:_:file:line:)-3pf4p`` that represents the lifecycle
933+
/// The type returned from ``TestStore/send(_:_:file:line:)-6s1gq`` that represents the lifecycle
935934
/// of the effect started from sending an action.
936935
///
937936
/// You can use this value in tests to cancel the effect started from sending an action:

0 commit comments

Comments
 (0)