Skip to content

empty string vs "/" #1730

@pociej

Description

@pociej

I wouldn't say its bug but maybe its a bit strange behaviour.
Compare two cases

it("should just pass", done => {
  nock("http://test.com")
    .post("")
    .reply(200, function(url, data) {
      return {};
    });
  got.post("http://test.com", {});
  done();
});
it("should just pass", done => {
 nock("http://test.com")
   .post("/")
   .reply(200, function(url, data) {
     return {};
   });
 got.post("http://test.com", {});
 done();
});

The first one fails because got( https://www.npmjs.com/package/got) makes request to http://test.com/ while nock is watching connections to http://test.com. But shouldn't those be equal from nock perspective?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions