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 body.exec is not a function #1006

Merged
merged 1 commit into from Oct 23, 2017

Conversation

halkeye
Copy link
Contributor

@halkeye halkeye commented Oct 23, 2017

Re-add support for matching body to query string regex

Fixes #1005 and #1004

This was working before the recent change to body parser.

From the docs:

The request body can be a string, a RegExp, a JSON object or a function.
var scope = nock('http://myapp.iriscouch.com')
                .post('/users', /email=.?@gmail.com/gi)
                .reply(201, {
                  ok: true,
                  id: '123ABC',
                  rev: '946B7D1C'
                });

@coveralls
Copy link

coveralls commented Oct 23, 2017

Coverage Status

Coverage increased (+0.01%) to 92.681% when pulling 1074a0a on halkeye:support-matching-body-with-regex into f22dcc3 on node-nock:master.

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.

That looks good, thanks a lot! Sorry for the regression :(

@gr2m gr2m merged commit be7a075 into nock:master Oct 23, 2017
@lock
Copy link

lock bot commented Sep 13, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants