Skip to content

nock not able to match all path segments for specific string with random segment value for last segment #2302

Answered by mastermatt
adamchenwei asked this question in Q&A
Discussion options

You must be logged in to vote

Answered on SO https://stackoverflow.com/a/71053312/823942


Nock supports Regex path matching. It seems you're attempting something similar with globs, however, if a string is provided Nock only does exact matching. Docs

For your case, something like this should get you going.

nock('https://app.launchdarkly.com')
  ...
  .options(/^\/sdk\/goals\//)
  ...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mastermatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #2301 on February 09, 2022 16:34.