You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/docs/08-testing.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ section: "Guide"
5
5
6
6
# Testing
7
7
8
-
The most valuable and easy to write tests for NuclearJS are unit tests. **The unit in Nuclear is the action.** The key assertion we want to make
8
+
The most valuable and easy to write tests for NuclearJS are unit tests. **The unit in NuclearJS is the action.** The key assertion we want to make
9
9
is that a particular action or set of actions properly transforms the Reactor from **State A** to **State B**.
10
10
11
11
This is done by setting up the reactor with the proper state, using actions, executing the action under test and asserting proper state via **Getters**.
12
12
13
13
## Example
14
14
15
-
In our testing example we will test our Project module while contains two stores, the `currentProjectIdStore` and the `projectStore` as well as
15
+
In our testing example we will test our Project module which contains two stores, the `currentProjectIdStore` and the `projectStore` as well as
When testing NuclearJS code it makes sense to test around actions asserting proper state updates via getters. While these tests may seem simple, they are
231
-
testing that our stores, actions and getters are all working in a cohesive manner. As your codebase scales out these tests be the foundation of unit tests
232
-
for all data flow and state logic.
230
+
When testing NuclearJS code it makes sense to test around actions by asserting proper state updates via getters. While these tests may seem simple, they are
231
+
testing that our stores, actions and getters are all working together in a cohesive manner. As your codebase scales, these tests can be the foundation of unit tests
232
+
for all your data flow and state logic.
233
233
234
234
Another thing to note is that we did not stub or mock any part of the NuclearJS system. While testing in isolation is good for a variety of reasons,
235
235
isolating too much will cause your tests to be unrealistic and more prone to breakage after refactoring. By testing the entire module as a unit
236
-
we are able to keep the test high level with limited stubs.
236
+
you are able to keep the test high level with limited stubs.
0 commit comments