Skip to content

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

monkpow
Copy link
Collaborator

@monkpow monkpow commented Apr 24, 2025

No description provided.

@monkpow monkpow requested a review from Copilot April 24, 2025 03:41
Copy link

@Copilot Copilot AI left a 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) {

});

target.get('/test-data', function (_, res) {
debugger;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

debugger

Comment on lines +82 to +83
var data = JSON.parse(proxyResData.toString('utf8'));
data.funkyMessage = 'oi io oo ii';
Copy link
Collaborator Author

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.

Comment on lines +67 to +69
if (err) { return done(err); }
assert.equal(res.text, 'mypost=hello');
done();
Copy link
Collaborator Author

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

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

Successfully merging this pull request may close these issues.

1 participant