Full code examples from this guide are available in the testing styleguide repository.
Use descriptive test names with “should”
Name tests using the “should” pattern. This makes test intent clear and failures easy to understand.Prefer const over let
Use const for all variable declarations. Immutable bindings prevent accidental reassignments and make test behavior predictable. Tests using let with shared hooks can silently use wrong contract instances when setup changes.