🏗
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:
1
# Add the as-pect assembly index and your entry points
2
asc entry.ts ./node_modules/@as-pect/assembly/assembly/index.ts \
3
# rtrace is used for testing memory leaks and arc problems
4
--use ASC_RTRACE=1 \
5
# prevent the module from starting immediately
6
--explicitStart \
7
# add debug symbols
8
--debug \
9
# validate the wasm output
10
--validate \
11
# output the binary file for compilation
12
--binaryFile output.wasm \
13
# Optional, output the wat text file for inspection
14
--textFile output.wat \
15
# Required, enable toStrictEqual and Reflect api
16
--transform ./node_modules/@as-pect/core/lib/transform/index.ts
Copied!
Last modified 1yr ago
Copy link