Skip to content

Add comments about assertions that use JS BitInts #39

Open
@bushidocodes

Description

@bushidocodes

A student might not be familiar with the JavaScript type system, which bleeds through via the n suffix in the test that get logged to console. Investigate ways to document or clarify that this is a wasm i64.

CODE RUN

let resultSigned = currentInstance.exports.square(1n);
let resultUnsigned = BigInt.asUintN(64, resultSigned);
expect(resultUnsigned).toEqual(1n);

TEST FAILURE

Error: expect(received).toEqual(expected) // deep equality

Expected: 1n
Received: 42n

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions