node/test/wpt/test-wasm-jsapi.mjs
Guy Bedford cd391b5f11 test: wpt for Wasm jsapi including new ESM Integration tests
PR-URL: https://github.com/nodejs/node/pull/59034
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-03-31 09:59:23 -07:00

22 lines
684 B
JavaScript

// Flags: --experimental-wasm-modules
import * as fixtures from '../common/fixtures.mjs';
import { ok } from 'node:assert';
import { WPTRunner } from '../common/wpt.js';
// Verify we have Wasm SIMD support by importing a Wasm with SIMD
// since Wasm SIMD is not supported on older architectures such as IBM Power8.
let supportsSimd = false;
try {
await import(fixtures.fileURL('es-modules/globals.wasm'));
supportsSimd = true;
} catch (e) {
ok(e instanceof WebAssembly.CompileError);
ok(e.message.includes('SIMD unsupported'));
}
if (supportsSimd) {
const runner = new WPTRunner('wasm/jsapi');
runner.setFlags(['--experimental-wasm-modules']);
runner.runJsTests();
}