-
Notifications
You must be signed in to change notification settings - Fork 235
Implement code coverage metrics, remove httpbin from test suite. #557
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes dependency on external httpbin endpoints by switching tests to use a local proxy target, while also adjusting timeouts and response assertions to improve test reliability and code coverage metrics.
- Updated tests to use a local proxy target instead of httpbin.org
- Adjusted timeouts and refined response assertions across multiple test files
- Enhanced the sendProxyRequest logic by adding a fallback to a default implementation
Reviewed Changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/verbs.js | Updated proxy endpoint and refined assertions for various HTTP methods |
test/userResDecorator.js | Modified endpoints to use localhost and updated tests for response decorators and header manipulation |
test/support/proxyTarget.js | Changed endpoints and introduced new routes; debugging code added |
test/session.js | Updated proxy endpoint and assertions for session preservation |
test/https.js | Refined HTTPS configuration tests using Promise-based assertions |
test/headers.js | Adjusted header assertions with lower-case keys |
lib/resolveOptions.js | Added support for sendProxyRequest option |
app/steps/sendProxyRequest.js | Updated function naming and fallback mechanism |
Files not reviewed (3)
- .eslintrc: Language not supported
- .nycrc: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (1)
test/userResDecorator.js:149
- There is a typo in the test description: 'mutuate' should be corrected to 'mutate'.
it('can mutuate an html response', function (done) {
test/support/proxyTarget.js
Outdated
}); | ||
|
||
target.get('/test-data', function (_, res) { | ||
debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugger
var data = JSON.parse(proxyResData.toString('utf8')); | ||
data.funkyMessage = 'oi io oo ii'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird. I see that the way we're generating responses is different, but I want to re-read this more closely.
if (err) { return done(err); } | ||
assert.equal(res.text, 'mypost=hello'); | ||
done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like this less. Let's see if we can make that look more like the original text
No description provided.