Closed vbence86 closed 7 years ago
Hey @vbence86, please see https://github.com/metal/metal-uri/issues/11 for the rationale behind the TypeError
exception and https://github.com/metal/metal-uri/pull/12 for the PR that went in.
Maybe we missed something?
@jbalsas Thanks for shading some light on this, the initial goal of the test is now crystal clear. According to the WHATWG living standard of URI the relevant definition is the following:
If port is greater than 2^16 − 1, validation error, return failure.
I suggest to change the description of the test case at first. I've created a PR for that - https://github.com/metal/metal-uri/pull/16
The reason why the tests are failing is that various browsers do not parse the given URL with regards to this expectation and the link.protocol
doesn't equal to :
character.
To follow this up, I've created a Pull Request that addresses the mentioned issue. https://github.com/metal/metal-uri/pull/17
Hey @vbence86
I'm assuming #18 closes this issue?
@Robert-Frampton Indeed, I merely forgot to update that issue after #18 had been merged.
Declaimer
This module has been linked to Travis CI in
travis
branch (https://github.com/metal/metal-uri/tree/travis), but the test apparently fails against certain Saucelabs browsers.Travis Output
https://travis-ci.org/metal/metal-uri/builds/258612453
Recurring issues
parseFromAnchor should throw a TypeError exception on invalid URLs FAILED
parse should throw a TypeError exception on invalid URLs FAILED
While looking into this issue we came across that the function responsable for URL validation is a bit dodgy and fails in its purpose. It creates an
<a>
instance and sets itshref
attribute against the given URL that is believed to be invalid. The specified browsers taking part in the test nevertheless automatically generate a valid URL out of this invalid one by invoking a transparent native code as soon as the<a>
instance'shref
attribute is altered.Proposal
Please double check whether or not the existence of this test provides any value to the building process.
The dodgy code snippet copied from
parseFromAnchor.js