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

fetch API rasies TypeError when argument is URL object #1613

Closed
generalov opened this issue May 13, 2018 · 1 comment
Closed

fetch API rasies TypeError when argument is URL object #1613

generalov opened this issue May 13, 2018 · 1 comment
Assignees
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Milestone

Comments

@generalov
Copy link

generalov commented May 13, 2018

"testcafe": "0.19.2"

https://developer.mozilla.org/en-US/docs/Web/API/URL contains an example there URL object is using in fetch API argruments:

const response = await fetch(new URL('http://www.example.com/démonstration.html'));

The same works fine on a page, but it throws 'Error: TypeError' exception when the page is testing in testcafe.

As temporary workaround I added .toString() method to our code:

const response = await fetch(new URL('http://www.example.com/démonstration.html').toString());
@miherlosev miherlosev added this to the Sprint #12 milestone May 14, 2018
@LavrovArtem LavrovArtem assigned Farfurix and unassigned LavrovArtem May 15, 2018
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
…evExpress#1613) (DevExpress#1623)

* fix `fetch API rasies TypeError when argument is URL object`

* requested changes, fix Safari case

* refactoring

* requested changes

* requested changes

* requested changes: fix tests

* add URL test case

* xhr, location.href, location.assign, location.replace cases

* requested changes: fix xhr.open test, remove unnecessary testcase in window-test.js

* requested changes: refactor xhr.open test

* fix location property case

* try to fix tests

* try to fix tests

* fix location property test

* try to fix location property test

* try to fix location property test

* fix double quotation in location property test

* requested changes

* requested changes

* restore xhr.responseURL test
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Projects
None yet
Development

No branches or pull requests

4 participants