{"type":"rich","version":"1.0","provider_name":"Transistor","provider_url":"https://transistor.fm","author_name":"Programming Tech Brief By HackerNoon","title":"My Tests Fail If Anyone Types a Dollar Amount by Hand","html":"<iframe width=\"100%\" height=\"180\" frameborder=\"no\" scrolling=\"no\" seamless src=\"https://share.transistor.fm/e/5329efef\"></iframe>","width":"100%","height":180,"duration":493,"description":"\n        This story was originally published on HackerNoon at: https://hackernoon.com/my-tests-fail-if-anyone-types-a-dollar-amount-by-hand.\nA one-line Vitest rule bans hand-typed prices in MDX; components and build-time SVG charts pull every number from one function.\nCheck more stories related to programming at: https://hackernoon.com/c/programming.\n            You can also check exclusive content about #programming, #javascript, #web-development, #testing, #astro, #data-visualization, #svg, #static-site-generator,  and more.\nThis story was written by: @horushe93. Learn more about this writer by checking @horushe93's about page,\n            and for more stories, please visit hackernoon.com.\nI 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.","thumbnail_url":"https://img.transistorcdn.com/KhCapPSRkLGL2Xw8888yuChkNRWthaKapLYTvNdu4W4/rs:fill:0:0:1/w:400/h:400/q:60/mb:500000/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9zaG93/LzQxMTY2LzE2ODM1/ODIzMzAtYXJ0d29y/ay5qcGc.webp","thumbnail_width":300,"thumbnail_height":300}