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

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

Comments

@loadbrain
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)

Details

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

This comment has been minimized.

Copy link
Collaborator

commented Jul 30, 2019

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

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

Checkout official doc.

@loadbrain

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

Thanks!
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
Projects
None yet
3 participants
You can’t perform that action at this time.