For many years my main headache was “to test, or not to test”.
Tests are very important to ensure that code operates as intended, doesn’t break later, and as a way to document code, especially business decisions.
But tests also come with a heavy tax in the form of constant maintenance — especially frontend and E2E tests.
Balancing usefulness, coverage and cost was a constant effort full of uncertainty.
My go-to mix as a frontend engineer was documenting business logic in tests, testing weak spots, and covering everything with visual regression tests, as they had the best effort/problem detection ratio.
Agentic coding made writing and maintaining tests cost zero human-hours. Now you can have your code fully covered with unit tests, Storybook stories, and E2E scenarios at no human cost — you just need to require writing & updating them in your AGENTS.md.
Let’s take this idea further
Apart from the standard set of tests, like unit, E2E and visual tests, you can now build entirely custom assertions.
These can be useful to test hard-to-reach spots, or just to automatically provide feedback to the model.
Examples of such assertions:
- You can write custom ESLint rules to provide feedback to the model on lint. Like a rule that reminds the model not to spam comments, or to use
better-resultinstead oftry/catch - You can use more obscure testing tools without worrying about learning their syntax, lifecycle and so on. For example, write Hurl tests for chains of requests
- You can code entirely custom tests. For example, on my Cloudflare D1 projects, I have a script that parses SQL migrations and fails if it contains a wrong order of operations
- You can regex and fail if texts contain “Not X, but Y” or “smoking gun” :)