Skip to content

Commit

Permalink
Workaround 'rustwasm-ffi/tests/node' issues on Node.js 10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
j-devel committed Oct 18, 2023
1 parent b8a2910 commit d1c0110
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/rustwasm-ffi/tests/node/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const __modPath = `${outDir}/${libName}.min.js`;

const Mod = require(__modPath);

if (process.version > 'v12.') { // !! FIXME - issues with Node.js 10.x - CompileError: AsyncCompile: Compiling wasm function #21:<?> failed: Invalid opcode (enable with --experimental-wasm-se) @+13578
test('MyClass', async () => {
const wbg = await Mod.create({nodejs: true});
expect(typeof Mod.ffi).toBe('object'); // e.g. {"MyClass": [Function A]}
expect(wbg.run(Mod.ffi)).toBe(10);
});
} // !!

0 comments on commit d1c0110

Please sign in to comment.