Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments about assertions that use JS BitInts #39

Open
bushidocodes opened this issue Mar 4, 2022 · 0 comments
Open

Add comments about assertions that use JS BitInts #39

bushidocodes opened this issue Mar 4, 2022 · 0 comments

Comments

@bushidocodes
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant