Skip to content

Matching and mandatory / in get #2042

@osenvosem

Description

@osenvosem

Let's assume I have a url like this http://domain.com/foo/bar?name=john without trailing slash. And try to mock it like this:

nock('http://domain.com/foo/bar')
    .persist()
    .get('') // here we have error: Non-wildcard URL path strings must begin with a slash
    .query(true)
    .delay(delayTime)
    .reply(200);

I don't wan't trailing slash in the url, but nock forces me to add it into .get(). If I add slash there, nock doesn't match my url.

Is this a bug or there is a way to do this without trailing slash?

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