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

One small question with expectbody #373

Open
MasonEast opened this issue May 26, 2021 · 3 comments
Open

One small question with expectbody #373

MasonEast opened this issue May 26, 2021 · 3 comments

Comments

@MasonEast
Copy link

I want to use expectbody, but it supports String, and I looked at your source code and it does:

if (this.opts.expectBody && this.opts.expectBody !== resp.body) {
      return this.emit('mismatch', resp.body)
}

The return body of my interface is an object. Your rules will very hard match. Why not use this:

if (this.opts.expectBody && !resp.body.includes(this.opts.expectBody)) {
      return this.emit('mismatch', resp.body)
}
@MasonEast MasonEast changed the title a little question with expectbody One small question with expectbody May 26, 2021
@mcollina
Copy link
Owner

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@MasonEast
Copy link
Author

Yes, it's my pleasure

@MasonEast
Copy link
Author

Hello, I simply added assertions to autocannon. pr has been mentioned

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

No branches or pull requests

2 participants