Skip to content

Matchers in expectJsonSnapshot not working? #98

Answered by ASaiAnudeep
captaincc423 asked this question in Q&A
Discussion options

You must be logged in to vote
Welcome to PactumJS Discussions & thanks a lot for using this library.
  1. I have tested includes and it is working as expected. It you could provide more info on this, it would help us to investigate further.
  2. There was a typo in our docs on the usage of regex. The function accepts two arguments - value & regex. Will update the docs and the function to accept a single argument.
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+/)
    });
});

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@captaincc423
Comment options

@ASaiAnudeep
Comment options

Answer selected by captaincc423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working documentation Improvements or additions to documentation
2 participants