Skip to content

Commit 54f9995

Browse files
committed
Use --fgrep for npm run test:tuwpt:browser
This makes it uniform with other npm run test:* commands.
1 parent 15e7664 commit 54f9995

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

scripts/verify-tuwpts-in-browser.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// https://web-platform-tests.org/running-tests/from-local-system.html#system-setup
1010
//
1111
// Usage:
12-
// node scripts/verify-tuwpts-in-browser.js [--browser=chrome] [filter ...]
12+
// node scripts/verify-tuwpts-in-browser.js [--browser=chrome] [--fgrep domparsing]
1313
//
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.
1617

1718
/* eslint-disable no-console */
1819

@@ -210,12 +211,13 @@ async function main() {
210211
const manifest = regenerateManifest(toUpstreamDir, resolve(wptDir, "tuwpt-manifest.json"));
211212
const testPaths = getPossibleTestFilePaths(manifest).map(p => "/" + p);
212213

213-
const { values: { browser }, positionals: filters } = parseArgs({
214-
allowPositionals: true,
214+
const { values: { browser, fgrep } } = parseArgs({
215215
options: {
216-
browser: { type: "string", short: "b" }
216+
browser: { type: "string", short: "b" },
217+
fgrep: { type: "string", multiple: true }
217218
}
218219
});
220+
const filters = fgrep ?? [];
219221
const filtered = filters.length > 0 ?
220222
testPaths.filter(p => filters.some(f => p.includes(f))) :
221223
testPaths;

test/to-port-to-wpts/PORTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ After creating or modifying to-upstream tests, verify they pass in a real
1313
browser:
1414

1515
```sh
16-
npm run test:tuwpt:browser # all to-upstream tests
17-
npm run test:tuwpt:browser -- domparsing # substring filter
16+
npm run test:tuwpt:browser # all to-upstream tests
17+
npm run test:tuwpt:browser -- --fgrep domparsing # substring filter
1818
```
1919

2020
This starts the WPT Python server, opens your default browser, runs the tests,

0 commit comments

Comments
 (0)