You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kdheepak
changed the title
Add section on how to write tests and run tests for the ratatui library as part of the developer guide
Add section on how to write tests and run tests for the ratatui library
May 2, 2024
We also also add instructions for cargo nextest and how to run a subset of tests using that.
Personally I would try to explain everything for cargo test too. As long as it works with standard. nextest might execute faster but is not part of the default cargo experience which people are familiar with. As long as it works with the standard tools without installing anything additionally we should keep that working to reduce the entry barrier.
Side note… git config --global core.hooksPath /dev/null was one of the best things I did since I worked on ratatui… I don't have cargo-make installed anymore too. Only typos is remaining for my local setup.
Side note… git config --global core.hooksPath /dev/null was one of the best things I did since I worked on ratatui… I don't have cargo-make installed anymore too. Only typos is remaining for my local setup.
Yeah, I often git push --no-verify before I create a PR (gh pr create) to avoid the time suck of running the CI while pushing too. We should definitely shorten that process a whole bunch to avoid it being a papercut that gets turned off.
In the developer guide, we should add a section on how to write tests and run tests.
This section should include a brief primer on
cargo test
, e.g.:cargo test
but if you want to print to stdout, you can use-- --nocapture
.--lib
flag.e.g.
We also also add instructions for
cargo nextest
and how to run a subset of tests using that.In terms of writing tests, some modules use
rstest
, which can make writing a series of specification tests like so quite easily to parse:This use the
rstest
crate. A specific case from a test can be run by using something like the following:Sometimes, the case has more information in the name like in this section and then to run case 08 you can do this:
The text was updated successfully, but these errors were encountered: