Skip to content

Commit d0ea212

Browse files
authored
Update readme.md
1 parent 4b30fb5 commit d0ea212

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ it("When visiting TestJavaScript.com home page, a menu is displayed", () => {
536536

537537
<br/><br/>
538538

539-
## ⚪ ️Copy code, but only that's neccessary
539+
## ⚪ ️Copy code, but only what's neccessary
540540

541541
:white_check_mark: **Do:** Include all the necessary details that affect the test result, but nothing more. As an example, consider a test that should factor 100 lines of input JSON - Pasting this in every test is tedious. Extracting it outside to transferFactory.getJSON() will leave the test vague - Without data, it's hard to correlate the test result with the cause ("why is it supposed to return 400 status?"). The classic book x-unit patterns named this pattern 'the mystery guest' - Something unseen affected our test results, we don't know what exactly. We can do better by extracting repeatable long parts outside AND mention explictly which specific details matter to the test. Going with the example above, the test can pass parameters that highlight what is important: transferFactory.getJSON({sender: undefined}). In this example, the reader should immediately infer that the empty sender field is the reason why the test should expect a validation error or any other similar adequate outcome.
542542
<br/>

0 commit comments

Comments
 (0)