Skip to content

Commit cac46a2

Browse files
committed
chore: merge options in store
1 parent 27eabf1 commit cac46a2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/api/requests/stores.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)