Programming Tech Brief By HackerNoon
Programming Tech Brief By HackerNoon · Oct 26, 2026 · 8:13
Listen in the Podli app 🎧
Follow your favourite podcasts, listen offline and in the car with CarPlay and Android Auto, and always pick up where you left off. Free to try.
This story was originally published on HackerNoon at: https://hackernoon.com/my-tests-fail-if-anyone-types-a-dollar-amount-by-hand.
A one-line Vitest rule bans hand-typed prices in MDX; components and build-time SVG charts pull every number from one function.
Check more stories related to programming at: https://hackernoon.com/c/programming.
You can also check exclusive content about #programming, #javascript, #web-development, #testing, #astro, #data-visualization, #svg, #static-site-generator, and more.
This story was written by: @horushe93. Learn more about this writer by checking @horushe93's about page,
and for more stories, please visit hackernoon.com.
I run a concrete cost calculator whose data refreshes monthly, so any price typed into an article goes stale. My rule: no dollar sign followed by a digit anywhere in prose. A Vitest test enforces it, MDX components put computed numbers inside sentences, and one pure function feeds the table, a zero-JS SVG chart and its alt text. Tests also pin the direction of each claim the prose makes.
Episodes: Programming Tech Brief By HackerNoon