Skip to content
File

Blob: src/wpt/url-test.ts

typescript75 lines
1// Copyright (c) 2017-2022 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5import { type TestRunnerConfig } from 'harness/harness';
6 
7export default {
8 'IdnaTestV2-removed.window.js': {},
9 'IdnaTestV2.window.js': {},
10 'historical.any.js': {},
11 'idlharness.any.js': {
12 comment:
13 'IDL tests fail because Workers exposes globals differently than browsers (not as own properties of self)',
14 expectedFailures: [
15 'URLSearchParams interface: iterable<USVString, USVString>',
16 ],
17 },
18 'javascript-urls.window.js': {
19 comment: 'Implement `globalThis.document`',
20 expectedFailures: [
21 'javascript: URL that fails to parse due to invalid host',
22 'javascript: URL that fails to parse due to invalid host and has a U+0009 in scheme',
23 'javascript: URL without an opaque path',
24 'javascript: URL containing a JavaScript string split over path and query',
25 'javascript: URL containing a JavaScript string split over path and query and has a U+000A in scheme',
26 'javascript: URL with extra slashes at the start',
27 ],
28 },
29 'percent-encoding.window.js': {
30 comment:
31 'Implement test code modification feature to allow running this test without document',
32 disabledTests: true,
33 },
34 'toascii.window.js': {
35 replace: (code): string =>
36 code.replace(/\["url", "a", "area"\]/, '[ "url" ]'),
37 },
38 'url-constructor.any.js': {},
39 'url-origin.any.js': {},
40 'url-searchparams.any.js': {},
41 'url-setters-a-area.window.js': {
42 comment:
43 'Excluded because it uses the same test data as url-setters.any.js',
44 // Node does the same: https://github.com/nodejs/node/blob/5ab7c4c5b01e7579fd436000232f0f0484289d44/test/wpt/status/url.json#L24
45 omittedTests: true,
46 },
47 'url-setters-stripping.any.js': {},
48 'url-setters.any.js': {},
49 'url-statics-canparse.any.js': {},
50 'url-statics-parse.any.js': {},
51 'url-tojson.any.js': {},
52 'urlencoded-parser.any.js': {
53 comment:
54 'Requests fail due to HTTP method "LADIDA", responses fail due to shift_jis encoding',
55 expectedFailures: [
56 /request.formData\(\) with input:/,
57 /response.formData\(\) with input:/,
58 ],
59 },
60 'urlsearchparams-append.any.js': {},
61 'urlsearchparams-constructor.any.js': {
62 comment: 'Fix this eventually',
63 expectedFailures: ['URLSearchParams constructor, DOMException as argument'],
64 },
65 'urlsearchparams-delete.any.js': {},
66 'urlsearchparams-foreach.any.js': {},
67 'urlsearchparams-get.any.js': {},
68 'urlsearchparams-getall.any.js': {},
69 'urlsearchparams-has.any.js': {},
70 'urlsearchparams-set.any.js': {},
71 'urlsearchparams-size.any.js': {},
72 'urlsearchparams-sort.any.js': {},
73 'urlsearchparams-stringifier.any.js': {},
74} satisfies TestRunnerConfig;