Matchers in expectJsonSnapshot not working? #98
Answered
by
ASaiAnudeep
captaincc423
asked this question in
Q&A
-
I'm trying to get some matchers to work in expectJsonSnapshot and I'm running into a few problems:
Am I misusing these matchers? |
Beta Was this translation helpful? Give feedback.
Answered by
ASaiAnudeep
Dec 1, 2021
Replies: 1 comment 2 replies
-
Welcome to PactumJS Discussions & thanks a lot for using this library.
it('first-post', async () => {
await pactum.spec().name('first-post')
.get('https://jsonplaceholder.typicode.com/posts/1')
.expectJsonSnapshot({
title: includes("provident"),
id: regex(1, /\d+/)
});
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
captaincc423
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Welcome to PactumJS Discussions & thanks a lot for using this library.
includes
and it is working as expected. It you could provide more info on this, it would help us to investigate further.regex
. The function accepts two arguments - value & regex. Will update the docs and the function to accept a single argument.