Skip to content

Commit 18a0e7d

Browse files
isidoreJayBazuziScottBob
committed
. e Refactoring tests
Co-Authored-By: Jay Bazuzi <1259628+JayBazuzi@users.noreply.github.com> Co-Authored-By: Scott Wierschem <28421044+ScottBob@users.noreply.github.com>
1 parent 7025172 commit 18a0e7d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# Unit Test Style Guide
22

3+
## Refactoring
4+
5+
**NEVER** add new test cases while refactoring existing tests.
6+
7+
**ALWAYS** prefer self documenting code and smaller functions to comments.
8+
39
## Approvals vs Asserts
410

511
* Preferable tests over multiple asserts.
612
* Use toStrings and Printers. If the toString on an object is good, use it. If not, create a printing function either in the test or in production code and use that.
713

814
### Dates, GUIDS and other non-deterministic values
915

10-
Use [Scrubbers](../approvaltests/docs/Scrubbers.md) to remove non-deterministic values from the output.
16+
If you are printing dates, guids, or any other non-deterministic values to an `.approved.` file.
17+
Please read [Scrubbers](../approvaltests/docs/Scrubbers.md) and add on Options to the Approvals.verify call.

0 commit comments

Comments
 (0)