Skip to content

Commit

Permalink
test(wpt): filter runnable test files
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 21, 2023
1 parent f5b0fdb commit 7463d5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/wpt/runner/runner/runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class WPTRunner extends EventEmitter {
this.#folderPath = join(testPath, folder)
this.#files.push(...WPTRunner.walk(
this.#folderPath,
(file) => file.endsWith('.js')
(file) => file.endsWith('.any.js') && !file.includes('.tentative.')
))
this.#status = JSON.parse(readFileSync(join(statusPath, `${folder}.status.json`)))
this.#url = url
Expand Down Expand Up @@ -112,14 +112,18 @@ export class WPTRunner extends EventEmitter {
const code = test.includes('.sub.')
? handlePipes(readFileSync(test, 'utf-8'), this.#url)
: readFileSync(test, 'utf-8')
if (code.includes('importScripts(')) {
total -= 1
return undefined
}
const meta = this.resolveMeta(code, test)

if (meta.variant.length) {
total += meta.variant.length - 1
}

return [test, code, meta]
})
}).filter(Boolean)

for (const [test, code, meta] of files) {
if (this.#status[basename(test)]?.skip) {
Expand Down

0 comments on commit 7463d5b

Please sign in to comment.