Skip to content

Suggested additional WHATWG URL test coverage #20720

@domenic

Description

@domenic

In web-platform-tests/wpt#10955 we are slightly changing the way in which bad base URLs are tested for the WHATWG URL API's canonical urltestdata.json file. I believe Node also makes use of that file and so might want to adapt.

Basically, we are removing the three tests that currently exist which test bad base URLs, in favor of the following:

In addition to testing that parsing input against base gives the result, a test harness for the URL constructor (or similar APIs) should additionally test the following pattern: if failure is true, parsing about:blank against base must give failure. This tests that the logic for converting base URLs into strings properly fails the whole parsing algorithm if the base URL cannot be parsed.

You can see an example of how to do this in jsdom/whatwg-url#116; probably Node.js will want to do something similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions