How to use the @as-pect/core.TestContext function in @as-pect/core

To help you get started, we’ve selected a few @as-pect/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AssemblyScript / node / tests / node.js View on Github external
function runTest(file, type, binary, wat) {
  const context = new TestContext({
    fileName: file,
    reporter,
    stderr: process.stderr,
    stdout: process.stdout,
  });
  const imports = context.createImports({
    wasi_unstable: wasi.exports,
  });
  const wasm = instantiateBuffer(binary, imports);
  wasi.setMemory(wasm.memory);
  wasi.view = new DataView(wasm.memory.buffer);
  context.run(wasm);
}

@as-pect/core

Write AssemblyScript tests at blazing fast speeds

MIT
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis

Popular @as-pect/core functions