Skip to content

MockAgent origin is case-sensetive #4703

@artur-ma

Description

@artur-ma

Bug Description

MockAgent comparse the origin in case-sensetive way

Reproducible By

    const url = 'http://myEndpoint';

    const mockAgent = new MockAgent();
    const mockPool = mockAgent.get(url);
    mockPool
      .intercept({
        path: '/path',
        method: 'GET',
      })
      .reply(
        200,
        { key: 'value' },
        {
          headers: { 'content-type': 'application/json' },
        },
      );

    await mockAgent.request({
      origin: new URL(url),
      method: 'GET',
      path: '/path',
    });

Expected Behavior

The reuqest is interecepted and correct reply returned

Logs & Screenshots

but actuin behavior is

getaddrinfo ENOTFOUND myendpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions