Skip to content

Added prefix option for agents#465

Open
Thann wants to merge 4 commits into
forwardemail:masterfrom
Thann:prefix
Open

Added prefix option for agents#465
Thann wants to merge 4 commits into
forwardemail:masterfrom
Thann:prefix

Conversation

@Thann

@Thann Thann commented Mar 7, 2018

Copy link
Copy Markdown

This prevents users from having to repeat themselves in tests, by setting a common prefix for all routes.

@mikelax

mikelax commented May 14, 2018

Copy link
Copy Markdown
Contributor

I think this should be closed in favor of #453

@Thann

Thann commented May 14, 2018

Copy link
Copy Markdown
Author

These two PRs provide different features

@mikelax

mikelax commented May 17, 2018

Copy link
Copy Markdown
Contributor

@Thann yes you are right.
Let me give this some thought as I want to make sure if we start extending capabilities with extra "options" we do so in a way to keep the object Prototype manageable. I think along the lines of what you have with the optional options object is the way to go.

Comment thread test/supertest.js
});

describe('request.agent(app, {prefix})', function() {
it('should apply prefix', function(done) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you provide a successful test (e.g. with 200 status code) as well?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh yeah, I can't believe I didn't do that already!

@coveralls

coveralls commented May 4, 2019

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 407

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.8%) to 99.111%

Totals Coverage Status
Change from base Build 404: 1.8%
Covered Lines: 141
Relevant Lines: 142

💛 - Coveralls

1 similar comment
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 407

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.8%) to 99.111%

Totals Coverage Status
Change from base Build 404: 1.8%
Covered Lines: 141
Relevant Lines: 142

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants