| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| test(function() { | ||
| var params = new URLSearchParams('a=1&a=2&a=3&a'); | ||
| assert_true(params.has('a'), 'Search params object has name "a"'); | ||
| assert_true(params.has('a'), `Search params object doesn't have name "a"`); |
There was a problem hiding this comment.
This will not pass make lint given that it is a plain string without any replacements. Please simply avoid the use of the contraction and make it a normal string.. e.g. 'Search params object does not have name "a"'.
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed, tested with make lint.
Sorry, something went wrong.
There was a problem hiding this comment.
We disable eslint for WPT tests though, because the styles are too different.. :D
Sorry, something went wrong.
There was a problem hiding this comment.
Still better to keep it consistent
Sorry, something went wrong.
| assert_true(matches && matches.length == 4, 'Search params object has values for name "a"'); | ||
| assert_array_equals(matches, ['1', '2', '3', ''], 'Search params object has expected name "a" values'); | ||
| assert(matches); | ||
| assert_equals(matches.length, 4, `Unexpected length of name "a" values in search params object: ${matches.length}`); |
There was a problem hiding this comment.
Please line wrap at 80 chars
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed in separate commit, I can squash them at the end.
Sorry, something went wrong.
|
@IvanJov, this specific test was imported directly from web-platform-tests, and we don't make any downstream changes. Can you submit the PR there instead? |
Sorry, something went wrong.
|
+1 on upstreaming the changes first. The tests are in their url directory, just send in a PR with the changes applied to a corresponding .html file would be enough I believe. |
Sorry, something went wrong.
|
@TimothyGu @joyeecheung Ah sorry, didn't know that. I am updating code on web-platform-tests. Let's keep this PR opened, in case that they accept it. What about other tests, can you tell me what tests are also imported from some other repo? 🙂 Thanks! |
Sorry, something went wrong.
|
Generally the imported tests should have a comment mentioning the source (I remember the old test-url-* has a few from an abandoned project), because attribution is required by a lot of licenses. I am not really sure about the history of other tests though. At the moment the WHATWG URL implementation is the only one in core that is really meant to be compatible with web standards I believe? I'll add a note to guides/writing-tests.md about this. |
Sorry, something went wrong.
|
@IvanJov Thanks for taking the time to work on Node.js! It looks like that test went through some significant modifications about a week after you and I discussed it. The part that I was referring to was removed in 10b687b and replaced with a port of the actual WPT test harness and tests. Sorry about that, and I hope you don't feel discouraged! If you want to try to find other places to contribute but you're not sure what to start with, http://nodetodo.org/next-steps/ might be helpful. |
Sorry, something went wrong.
|
Ah, didn't know it's a NodeTodo PR :D Sorry about the confusion. FWIW, I think the upstreaming process for WPT is not really a must, at least not as strict as we are about deps updates, it's just that having the same test suites is one of the points of implementing a web standard IMO, and it benefits other people using the tests, so why not :) |
Sorry, something went wrong.
|
@Trott Thanks, I will find something else to work on! Thanks a lot for your help! |
Sorry, something went wrong.
|
Given that, I'm going to close this. We can reopen if necessary after changes have been upstreamed. |
Sorry, something went wrong.
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: nodejs#11150 Ref: nodejs#11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: nodejs#11150 Ref: nodejs#11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: nodejs#11150 Ref: nodejs#11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: #11150 Ref: #11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: #11150 Ref: #11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: #11150 Ref: #11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Add guide on choice of assertions, use of ES.Next features, and the WPT upstream. PR-URL: #11150 Ref: #11142 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
| Back | FazBrowse Home | New Git URL |
I have updated assertions in url-searchparams-getall tests, made them more clear
for debugging and improved test messages.
Checklist
Affected core subsystem(s)
no