summaryrefslogtreecommitdiff
path: root/test/parallel/test-whatwg-url-constructor.js
AgeCommit message (Collapse)Author
2018-11-09test: initialize test/wpt to run URL and console .js testsJoyee Cheung
This patch: - Creates a new test suite `wpt` that can be used to run a subset of Web Platform Tests - Adds a `WPTRunner` in `test/common/wpt.js` that can run the WPT subset in `test/fixtures/wpt` with a vm and the WPT harness while taking the status file in `test/wpt/status` into account. Here we use a new format of status file (in JSON) to handle specific requirements (like ICU requirements) in the tests and to handle expected failures and TODOs. - Adds documentation on how the runner and the update automation works - Runs the WHATWG URL tests and the console tests with the new test runner. With this patch we eliminates the need of copy-pasting with manual modifications to update a large chunk of our WPT subset previously maintained in `test/parallel`. Now the tests run in `test/wpt` can be automatically updated with `git node wpt` without modifications by the actual WPT harness instead of our home-grown mock. There are still a few URL tests left that need to be migrated in the upstream to be placed in .js instead of .html - we currently still use the legacy harness mock in the test files. PR-URL: https://github.com/nodejs/node/pull/24035 Refs: https://github.com/nodejs/node/issues/23192 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09test: use URL fixtures under test/fixtures/wpt/url/resourcesJoyee Cheung
Removes the following files: - test/fixtures/url-tests.js - test/fixtures/url-setter-tests.js - test/fixtures/url-toascii.js in favor of: - test/fixtures/wpt/url/resources/urltestdata.json - test/fixtures/wpt/url/resources/setters_tests.json - test/fixtures/wpt/url/resources/toascii.json Also removes dependency of `fixtures/url-tests.js` in http2 tests and use `fixtures/person-large.jpg` instead since they are just looking for a big enough file to transfer. PR-URL: https://github.com/nodejs/node/pull/24035 Refs: https://github.com/nodejs/node/issues/23192 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-08-07test: begin normalizing fixtures useJames M Snell
Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-07-20test: add comments for whatwg-url testsGautam Arora
Added comments to whatwg-url tests that they should not be changed until modifications are merged upstream as per "Web Platform Tests" guidelines PR-URL: https://github.com/nodejs/node/pull/14355 Fixes: https://github.com/nodejs/node/issues/12793 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-04test: simplify test skippingVse Mozhet Byt
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-03test: move WPT to its own testing moduleRich Trott
This is first in a hoped-for series of moves away from a monolithic common.js that is loaded for every test and towards a more modular approach. (In the end, common.js will hopefully contain checks for variables leaking into the global space and perhaps some of the more ubiquitous functions like common.mustCall().) Move the WPT testing code to its own module. PR-URL: https://github.com/nodejs/node/pull/12736 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-03-14url: spec-compliant URLSearchParams serializerTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/11626 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-02-21test: synchronize WPT url test dataJoyee Cheung
Synchronize url-tests to upstream b207902 and comment out incompatible tests PR-URL: https://github.com/nodejs/node/pull/11439 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-21test: remove WHATWG URL test data file extensionJoyee Cheung
Make url-tests a js file so we can comment out incompatible tests PR-URL: https://github.com/nodejs/node/pull/11439 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-16url: fix handling of ? in URLSearchParams creationTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/11372 Fixes: https://github.com/nodejs/node/issues/11093 Ref: https://github.com/whatwg/url/issues/248 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-02test, url: synchronize WPT url testsJoyee Cheung
* attributon of WPT in url-setter-tests * add WPT test utilities * synchronize WPT URLSearchParams tests * synchronize WPT url tests * split whatwg-url-inspect test * port historical url tests from WPT * protocol setter and special URLs Refs: https://github.com/w3c/web-platform-tests/pull/4413 Refs: https://github.com/whatwg/url/issues/104 PR-URL: https://github.com/nodejs/node/pull/11079 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>