Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): allow regexp on Definition#scope and #path #2374

Merged

Conversation

quaternion
Copy link
Contributor

No description provided.

@gr2m
Copy link
Member

gr2m commented Jun 27, 2022

Is this fixing an open issue? Can you add any more context about the change? It will help us with the review

@quaternion
Copy link
Contributor Author

This is bug without opened issue. Below are two code examples.

Original:

nock(/example\.com|org/)
  .get(/resource\/.+/)
  .reply(200, 'OK')

Same behaviour through define is throw typescript error:

nock.define([
  {
    scope: /example\.com|org/, // Type 'RegExp' is not assignable to type 'string'
    path: /resource\/.+/, // Type 'RegExp' is not assignable to type 'string'
    method: 'GET', 
    response: 'OK',
  },
])

Copy link
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@gr2m gr2m merged commit 2edf341 into nock:main Jun 30, 2022
16 checks passed
@github-actions
Copy link

🎉 This PR is included in version 13.2.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants