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.
7272
7373- ` options.status? ` - run the handler only on the given status. * Can be either 'PASSED' or 'FAILED'*
7474- ` options.append? ` - appends the stored data in an array.
75+ - ` options.merge? ` - merges the stored data in a single object.
7576
7677## Examples
7778
@@ -157,6 +158,22 @@ await spec()
157158 .stores (' UserIds' , ' id' , { append: true });
158159```
159160
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+
160177## See Also
161178
162179- [ Integration Testing] ( /guides/integration-testing )
You can’t perform that action at this time.
0 commit comments