Skip to content
Discussion options

You must be logged in to vote

It depends on the granularity of what you're trying to test, but you might want to try writing rust unit tests within the module you're trying to debug. To run a specific test you can specify the name of the function you defined:

cargo test name_of_my_test_case

And if you want to make sure that any logging you do actually gets displayed in the console, include the --nocapture flag:

cargo test name_of_my_test_case -- --nocapture

For things that can't be simulated entirely on the rust side I typically do as you describe:

  • update the rust code (using dbg! and println! to peek at values)
  • run the default make rule to do an un-optimized build
  • run node my-test-script.js

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by loveloki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants