koehr.ing/content/til/2022-06-15.smd
2024-09-16 22:02:39 +02:00

14 lines
572 B
Text

---
{
.title = "Disallowed Focussed Tests and how it saved my day",
.date = @date("2022-06-15T00:00:00"),
.author = "koehr",
.draft = false,
.layout = "til.shtml",
.description = "",
.tags = [],
}
---
Today I was about to push a focussed test. A focussed test, you ask?
In Jest (and others) one can run only a specific test, by writing `it.only(...`. Pushing this to production might create some funny or not so funny side effects though. Luckily there is the `no-focussed-tests` linter rule in [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest).