Skip to content

Commit

Permalink
test: re-enable conditional WPT Report for websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Nov 7, 2023
1 parent 7b5c851 commit 32d0a23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/wpt/start-websockets.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import { WPTRunner } from './runner/runner.mjs'
import { join } from 'path'
import { fileURLToPath } from 'url'
import { fork } from 'child_process'
import { fork, execSync } from 'child_process'
import { on } from 'events'
import { argv } from 'process'

const { WPT_REPORT } = process.env

function isExperimentalAvailable () {
return execSync(`${argv[0]} --expose-internals --print 'typeof require("internal/options").getOptionValue("--experimental-websocket") === "boolean"'`, { encoding: 'utf8' }) === 'true'
}

function isGlobalAvailable () {
if (typeof WebSocket !== 'undefined') {
return true
}

return process.execArgv.includes('--experimental-websocket')
return isExperimentalAvailable()
}

if (process.env.CI) {
Expand Down

0 comments on commit 32d0a23

Please sign in to comment.