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 framework for writing unit tests #272

Closed
Tracked by #222
ma2bd opened this issue Jan 2, 2023 · 2 comments · Fixed by #341
Closed
Tracked by #222

Add framework for writing unit tests #272

ma2bd opened this issue Jan 2, 2023 · 2 comments · Fixed by #341
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ma2bd
Copy link
Contributor

ma2bd commented Jan 2, 2023

Motivation

It should be straight forward for developers of user applications to be able to write unit tests for their applications. Ideally, it should use the same test infrastructure used for normal application development.

@ma2bd ma2bd mentioned this issue Jan 2, 2023
20 tasks
@ma2bd
Copy link
Contributor Author

ma2bd commented Jan 2, 2023

See also near/near-sdk-rs#467

@ma2bd ma2bd added this to the Local testnet milestone Jan 2, 2023
@jvff jvff moved this to Todo in Wasm VM Integration Jan 11, 2023
@jvff jvff added the enhancement New feature or request label Jan 11, 2023
@jvff jvff self-assigned this Jan 13, 2023
@jvff jvff moved this to Todo in Web3 SDK Jan 13, 2023
@jvff jvff moved this from Todo to In Progress in Web3 SDK Jan 13, 2023
@jvff
Copy link
Contributor

jvff commented Jan 13, 2023

See also near/near-sdk-rs#467

I started looking into this, and it seemed like the solution they reached was to write a custom procedural macro for tests (webassembly-test) and a custom test runner (webassembly-test-runner), as per this comment.

This seems like something we can do. I wrote some trivial tests for the counter example application and tried to run them using webassembly-test-runner. Unfortunately it didn't work because the WASM runtime says that it can't run the module without the system API exports it depends on. I started changing the test-runner to export the necessary functions, but I haven't finished yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants