๐Ÿ—๏ธAssemblyScript API

An introdocution to the @as-pect/assembly package

The goal of this package is to design the AssemblyScript api and communicate with the JavaScript host about the details of each test, group, and test result meaningfully. This includes the expect() describe() and test() functions,

To use the @as-pect/assembly package, typically, it's best to use the @as-pect/cli package to output a binary using --outputBinary. However in the case of generating the binary manually, it's possible to use the following AssemblyScript asc cli options:

# Add the as-pect assembly index and your entry points
asc entry.ts ./node_modules/@as-pect/assembly/assembly/index.ts \
  # rtrace is used for testing memory leaks and arc problems
  --use ASC_RTRACE=1 \
  # prevent the module from starting immediately
  --explicitStart \
  # add debug symbols
  --debug \
  # validate the wasm output
  --validate \
  # output the binary file for compilation
  --binaryFile output.wasm \
  # Optional, output the wat text file for inspection
  --textFile output.wat \
  # Required, enable toStrictEqual and Reflect api
  --transform ./node_modules/@as-pect/core/lib/transform/index.ts

Last updated