My Tests Fail If Anyone Types a Dollar Amount by Hand

https://hackernoon.imgix.net/images/79HRs4xnb5UK7XbfTI5Pz7TyOhu2-0bj3bkx.jpeg

I run a Concrete Cost Calculator that estimates what a home concrete job costs from public wage and price data. The data refreshes every month. That makes every dollar amount I type into an article a small liability: it is right on the day I write it, and nobody, including me, will notice the day it stops being right.

So I made a rule for my own writing. The body of an article may not contain a dollar sign followed by a digit. Numbers come from the same code that runs the calculator, charts are drawn from the same function as the tables, and a test fails the moment someone breaks the rule. Here is how that works in an Astro site, what it catches, and what it does not.

The Problem With a Number Inside a Sentence

A price in an article usually lives in two places. It sits...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more