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

Allow URL tests to run in non-browser runtimes #1295

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

ascorbic
Copy link
Contributor

Hi! I'm working on runtime-compat, which is a new project to collect some of the same data as BCD, but for non-browser JS runtimes. You can see its current state here: https://runtime-compat.unjs.io/ We've been using your tests from this project to track web API coverage, which are great for most purposes (thanks!). However there are a few cases where we're getting false failures because of implementation details in the tests. I hope you're OK with me contributing a small fix that will allow these tests to run outside the browser.
I've opened this PR to work around one of the main problems. All of the runtimes that we're testing support URL, however they don't set location.href. The URL and Request tests are showing as failures for all of these features, even though they are supported, because the tests either use an empty string, a relative URL or location.href, none of which work outside the browser. In this PR I've replaced the empty string and location.href with http://example.com. This shouldn't affect the tests for browsers, but will allow our tested runtimes to run the tests correctly.
Let me know if you have any questions, or if you'd like to join our Discord where we're organising this. Thanks!

Copy link
Member

@queengooborg queengooborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ascorbic, thank you for your PR! These changes look great to me!


I just looked into the runtime-compat project, and this looks super awesome! In the past, we had talked about integrating JS runtime support directly into the collector, but it's a project that has sat on the backburner (naturally, our focus has been on web browsers). I could have sworn there was an issue open to track this, but I can't find it... It is really amazing to see that not only is it possible for the collector to be used to get compatibility data for JS runtimes, but there is a project that does exactly that!

I would love to connect with you to synchronize efforts! While I don't personally use Discord much, I'd love to join -- I'm @queengooborg on there!

@queengooborg queengooborg merged commit dc11759 into openwebdocs:main Mar 16, 2024
2 checks passed
@ascorbic ascorbic deleted the url-location branch March 16, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants