Skip to content
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

url.substr is not a function using Polly and I.mockRequest #1815

loadbrain opened this issue Jul 30, 2019 · 2 comments · Fixed by #1816


Copy link

commented Jul 30, 2019

What are you trying to achieve?

I call I.mockRequest("/google-analytics/*path", 200);

What do you get instead?

 url.substr is not a function

Scenario Steps:
I call I.mockRequest("/google-analytics/*path", 200);

Provide console output if related. Use --verbose mode for more details.

    url.substr is not a function

  - I.mockRequest("/google-analytics/*path", 200) at Test.<anonymous> (Wiley_test.js:11:6)


  • CodeceptJS version: 2.2.1
  • NodeJS Version: 12.7.0
  • Operating System: Windows 10
  • Puppeteer || Polly
  • Configuration file:

This comment has been minimized.

Copy link

commented Jul 30, 2019

You need to pass the HTTP method or 'ANY' for all type of requests.

I.mockRequest('GET', '/google-analytics/*path', 200)

Checkout official doc.


This comment has been minimized.

Copy link

commented Jul 31, 2019

And sorry...

@loadbrain loadbrain closed this Jul 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.