# My Tests Fail If Anyone Types a Dollar Amount by Hand

DevFeed: [My Tests Fail If Anyone Types a Dollar Amount by Hand](<https://devfeed.tech/articles/my-tests-fail-if-anyone-types-a-dollar-amount-by-hand-99290.md>)

Original publisher: [Read original article](<https://hackernoon.com/my-tests-fail-if-anyone-types-a-dollar-amount-by-hand?source=rss>)

Author: horushe

Published: 2026-10-25T17:00:02Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Test automation](<https://devfeed.tech/topics/test-automation.md>), [MDX](<https://devfeed.tech/topics/mdx.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [accessible](<https://devfeed.tech/tags/accessible.md>), [alt-text](<https://devfeed.tech/tags/alt-text.md>), [astro](<https://devfeed.tech/tags/astro.md>), [bug](<https://devfeed.tech/tags/bug.md>), [build](<https://devfeed.tech/tags/build.md>), [calculator](<https://devfeed.tech/tags/calculator.md>), [charts](<https://devfeed.tech/tags/charts.md>), [components](<https://devfeed.tech/tags/components.md>), [concrete](<https://devfeed.tech/tags/concrete.md>), [cost](<https://devfeed.tech/tags/cost.md>), [data](<https://devfeed.tech/tags/data.md>), [data-visualization](<https://devfeed.tech/tags/data-visualization.md>), [fail](<https://devfeed.tech/tags/fail.md>), [function](<https://devfeed.tech/tags/function.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [mdx](<https://devfeed.tech/tags/mdx.md>), [number](<https://devfeed.tech/tags/number.md>), [prices](<https://devfeed.tech/tags/prices.md>), [programming](<https://devfeed.tech/tags/programming.md>), [static-site-generator](<https://devfeed.tech/tags/static-site-generator.md>), [svg](<https://devfeed.tech/tags/svg.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [time](<https://devfeed.tech/tags/time.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

## AI overview

The author prevents stale prices in Astro articles by testing every guide MDX file for a dollar sign followed by a digit, including drafts; separate checks ensure calculator pages are covered. Inline components render computed figures, while one pure function supplies the table, build time SVG chart, and chart description. Tests also verify that stated trends in the prose still match the data after refreshes. Supplier prices that cannot be computed are kept in a single source documented data file, though the test cannot verify transcription accuracy. The rule is enforced only when Vitest is run: the build does not run it, and the project has no CI. Its regex misses spelled out amounts, currency codes, and typed percentages, while untested prose claims can still become outdated.

## Source excerpt

A one-line Vitest rule bans hand-typed prices in MDX; components and build-time SVG charts pull every number from one function.