โšก
as-pect
  • โšกas-pect
  • ๐Ÿš€Getting Started
  • ๐Ÿ”งCLI Configuration
  • ๐Ÿ—๏ธAssemblyScript API
    • ๐Ÿ›๏ธTest Structure
    • ๐Ÿคทโ€โ™€๏ธ Expectations
      • ๐ŸŽญtoBe
      • ๐ŸคจtoStrictEqual
      • ๐ŸงฑtoBlockEqual
      • ๐Ÿ‘ฉโ€๐Ÿซ toBeTruthy and toBeFalsy
      • ๐Ÿ”ขtoBeNaN
      • ๐ŸšซtoBeNull
      • ๐ŸŒŒtoBeFinite
      • โšพtoThrow
      • โž•toBe(Greater|Less)Than
      • ๐Ÿ•ต๏ธโ€โ™€๏ธ toBeCloseTo
      • ๐Ÿ“toHaveLength
      • ๐ŸŽtoContain
      • ๐Ÿ“ฆtoContainEqual
      • โœ๏ธCustom Assertions
    • ๐ŸŽŸ๏ธTypes and Tooling
    • ๐Ÿช“Logging
    • ๐Ÿ‘ฉโ€๐Ÿ”ง RTrace and Memory Leaks
    • ๐Ÿ‘‰๐Ÿ‘ˆ Reflection
  • ๐ŸงถCore API
    • ๐ŸงชTestContext
    • ๐Ÿ‘ขBootstrap Tests Manually
    • ๐ŸŽ›๏ธTestGroup
    • โœ”๏ธTestResult
    • โœ๏ธReporters
      • ๐ŸฉณSummaryReporter
      • ๐Ÿ’ฌVerboseReporter
      • ๐ŸฅฝJSONReporter
      • ๐Ÿ—ƒ๏ธCSVReporter
Powered by GitBook
On this page

Was this helpful?

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

PreviousCLI ConfigurationNextTest Structure

Last updated 5 years ago

Was this helpful?

๐Ÿ—๏ธ