Try Varar in your browser
In this tutorial we’ll read an oath, break it, mend it, and then break it from the other side. The interactive example uses TypeScript, because we can run that in the browser.
You can select a different language in the top-right corner of the page, but you won’t be able to edit the code.
-
Read the oath below
The deep-thought.md file is ordinary Markdown prose — no special syntax, no keywords. One sentence in it makes a checkable claim, or an oath.
-
Break the oath
Change
42to41in the deep-thought.md file. Now the oath is broken. You can see the red squiggly line under the word41. Hover over it to see the expected value. -
Mend the oath
Change
41back to42in the deep-thought.md file. Now the oath is mended. -
Break it from the other side
Change
42to41in the deep-thought.steps.ts file. Now the oath is broken from the other side.
This is the whole idea of Varar: the document and the code check each other. When they disagree, your tests fail, and the failure points at the words.
What you just learned
Section titled “What you just learned”- A Varar spec is plain Markdown. You read it like documentation, because it is documentation.
- A sensor returns what the software actually does; Varar compares that against what the document claims.
- When document and code disagree — no matter which side drifted — the failure is anchored to the exact span in the document.
Ready to run Varar on your own machine? Get started on your computer — install, scaffold your first oath, and watch it fail on purpose.