File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ Options to pass to the handler.
72
72
73
73
- ` options.status? ` - run the handler only on the given status. * Can be either 'PASSED' or 'FAILED'*
74
74
- ` options.append? ` - appends the stored data in an array.
75
+ - ` options.merge? ` - merges the stored data in a single object.
75
76
76
77
## Examples
77
78
@@ -157,6 +158,22 @@ await spec()
157
158
.stores (' UserIds' , ' id' , { append: true });
158
159
```
159
160
161
+ ### Merges value to the store
162
+
163
+ ``` js
164
+ const { spec } = require (' pactum' );
165
+
166
+ await spec ()
167
+ .get (' http://jsonplaceholder.typicode.com/posts/1' )
168
+ .expectStatus (200 )
169
+ .stores (' POSTS' , ' .' , { merge: true });
170
+
171
+ await spec ()
172
+ .get (' http://jsonplaceholder.typicode.com/posts/2' )
173
+ .expectStatus (200 )
174
+ .stores (' POSTS' , ' .' , { merge: true });
175
+ ```
176
+
160
177
## See Also
161
178
162
179
- [ Integration Testing] ( /guides/integration-testing )
You can’t perform that action at this time.
0 commit comments