From 79a97f665d2e6d6cff963c1094a94359ad4c80e3 Mon Sep 17 00:00:00 2001 From: David Eisinger Date: Mon, 24 Jul 2023 14:19:40 -0400 Subject: [PATCH] [testing] not too DRY --- content/notes/good-tests/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/notes/good-tests/index.md b/content/notes/good-tests/index.md index 420d60f..f37de23 100644 --- a/content/notes/good-tests/index.md +++ b/content/notes/good-tests/index.md @@ -59,6 +59,12 @@ _(Notes for a Viget article I'm putting together)_ * [rspec-retry][6] * In general, though, flaky tests suck and generally indicate lack of quality with either your code or your tools * So write better code or pick better tools +* Tests are code, but they're not application code + * And the way you approach them should be slightly different + * Some (or even a lot of) repetition is OK; don't be too quick to refactor + * Ideally someone can get a sense of what a test is doing by looking at a single screen of code + * As opposed to jumping around between early setup, shared examples, complex factories w/ side-effects, etc. + * Think of it as half programming, half writing [1]: https://en.wikipedia.org/wiki/Test-driven_development [2]: https://www.viget.com/articles/maintenance-matters-code-coverage/