|
9 | 9 | // https://web-platform-tests.org/running-tests/from-local-system.html#system-setup |
10 | 10 | // |
11 | 11 | // Usage: |
12 | | -// node scripts/verify-tuwpts-in-browser.js [--browser=chrome] [filter ...] |
| 12 | +// node scripts/verify-tuwpts-in-browser.js [--browser=chrome] [--fgrep domparsing] |
13 | 13 | // |
14 | | -// Filters are substring matches against test paths. Without filters, all to-upstream tests are |
15 | | -// included. Use --browser (-b) to specify a browser command; otherwise opens the default browser. |
| 14 | +// `--fgrep` values are substring matches against test paths. Without them, all to-upstream tests |
| 15 | +// are included. Use --browser (-b) to specify a browser command; otherwise opens the default |
| 16 | +// browser. |
16 | 17 |
|
17 | 18 | /* eslint-disable no-console */ |
18 | 19 |
|
@@ -210,12 +211,13 @@ async function main() { |
210 | 211 | const manifest = regenerateManifest(toUpstreamDir, resolve(wptDir, "tuwpt-manifest.json")); |
211 | 212 | const testPaths = getPossibleTestFilePaths(manifest).map(p => "/" + p); |
212 | 213 |
|
213 | | - const { values: { browser }, positionals: filters } = parseArgs({ |
214 | | - allowPositionals: true, |
| 214 | + const { values: { browser, fgrep } } = parseArgs({ |
215 | 215 | options: { |
216 | | - browser: { type: "string", short: "b" } |
| 216 | + browser: { type: "string", short: "b" }, |
| 217 | + fgrep: { type: "string", multiple: true } |
217 | 218 | } |
218 | 219 | }); |
| 220 | + const filters = fgrep ?? []; |
219 | 221 | const filtered = filters.length > 0 ? |
220 | 222 | testPaths.filter(p => filters.some(f => p.includes(f))) : |
221 | 223 | testPaths; |
|
0 commit comments