This comparison is used to test and see if a function throws an error. In the case of AssemblyScript and as-pect, the function will be called from within a JavaScript try block, and if the function throws, the assertion is valid, unless it is negated with the not property.
expect(() => {
throw new Error("Whoops!");
Closure is not supported in AssemblyScript yet. Also, any references that are left dangling on the stack will hang around un__release()ed by AssemblyScript.
If this function is used on anything other than a () => void function type, it will result in a compile time error.
This function is safe to use with jest.