AtlatestRepositorysigil-irc
sigil-irc / tree / test / integrationtest-wasm-irc-websocket.sh
1
#!/usr/bin/env sh2
set -eu4
if ! command -v node >/dev/null 2>&1; then5
echo "SKIP: node is not installed; skipping WASM IRC websocket smoke"6
exit 07
fi9
NODE_FLAGS="--experimental-wasi-unstable-preview1"10
if ! node -e 'process.exit(typeof WebSocket === "function" ? 0 : 1)' >/dev/null 2>&1; then11
if node --experimental-websocket -e 'process.exit(typeof WebSocket === "function" ? 0 : 1)' >/dev/null 2>&1; then12
NODE_FLAGS="$NODE_FLAGS --experimental-websocket"13
else14
echo "SKIP: node with global WebSocket is required for WASM IRC websocket smoke"15
exit 016
fi17
fi19
exec node $NODE_FLAGS test/integration/test-wasm-irc-websocket.mjs