AtlatestRepositorysigil-irc

sigil-irc / tree / test / integrationtest-wasm-irc-websocket.sh

1#!/usr/bin/env sh
2set -eu
3
4if ! command -v node >/dev/null 2>&1; then
5 echo "SKIP: node is not installed; skipping WASM IRC websocket smoke"
6 exit 0
7fi
8
9NODE_FLAGS="--experimental-wasi-unstable-preview1"
10if ! node -e 'process.exit(typeof WebSocket === "function" ? 0 : 1)' >/dev/null 2>&1; then
11 if node --experimental-websocket -e 'process.exit(typeof WebSocket === "function" ? 0 : 1)' >/dev/null 2>&1; then
12 NODE_FLAGS="$NODE_FLAGS --experimental-websocket"
13 else
14 echo "SKIP: node with global WebSocket is required for WASM IRC websocket smoke"
15 exit 0
16 fi
17fi
19exec node $NODE_FLAGS test/integration/test-wasm-irc-websocket.mjs