<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vitest on Tokenise</title><link>https://tokenise.rosvetic.com/tags/vitest/</link><description>Recent content in Vitest on Tokenise</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sat, 31 Oct 2026 16:04:00 +0000</lastBuildDate><atom:link href="https://tokenise.rosvetic.com/tags/vitest/index.xml" rel="self" type="application/rss+xml"/><item><title>Run your README's code blocks as Vitest tests so an agent can't leave the docs lying</title><link>https://tokenise.rosvetic.com/posts/readme-code-blocks-as-vitest-tests/</link><pubDate>Sat, 31 Oct 2026 16:04:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/readme-code-blocks-as-vitest-tests/</guid><description>&lt;p&gt;An agent renames a function, updates every caller, fixes the tests, and ships a clean diff. The README still shows the old name. Nothing failed, because nothing reads the README except the next developer, who pastes the example, gets a compile error and loses ten minutes deciding whether to trust anything else on the page.&lt;/p&gt;</description></item><item><title>Move a JavaScript module to strict TypeScript one flag at a time, with the compiler and your tests as the gate</title><link>https://tokenise.rosvetic.com/posts/js-to-strict-typescript-one-flag-at-a-time/</link><pubDate>Fri, 30 Oct 2026 11:05:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/js-to-strict-typescript-one-flag-at-a-time/</guid><description>&lt;p&gt;A 400-line JavaScript module has to become TypeScript, and the obvious plan is to rename every file to &lt;code&gt;.ts&lt;/code&gt;, flip &lt;code&gt;strict&lt;/code&gt; on and let an agent grind through the errors. That plan produces a diff nobody can review. Hundreds of errors arrive at once, the fastest way to silence them is &lt;code&gt;any&lt;/code&gt; or a cast, and somewhere in the pile a &amp;ldquo;fix&amp;rdquo; quietly changes what the function returns.&lt;/p&gt;</description></item><item><title>Write the OpenAPI file first, then let the compiler and a short test catch every place the agent drifts from it</title><link>https://tokenise.rosvetic.com/posts/contract-first-openapi-csharp-vitest-drift/</link><pubDate>Fri, 30 Oct 2026 07:07:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/contract-first-openapi-csharp-vitest-drift/</guid><description>&lt;p&gt;The ticket says the invoice response has a &lt;code&gt;totalMinor&lt;/code&gt; field. The backend developer&amp;rsquo;s agent returns &lt;code&gt;total&lt;/code&gt;, because that read more naturally to it. The frontend developer&amp;rsquo;s agent calls &lt;code&gt;invoice.totalMinor&lt;/code&gt;, divides by 100 and renders &lt;code&gt;NaN&lt;/code&gt;. Both pull requests are green. Each side&amp;rsquo;s tests were written by the side that made the mistake, so each side agreed with itself.&lt;/p&gt;</description></item><item><title>Let the tests run while the agent keeps typing: a background hook that interrupts only when something breaks</title><link>https://tokenise.rosvetic.com/posts/async-rewake-test-hook-agent-edits/</link><pubDate>Wed, 28 Oct 2026 07:09:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/async-rewake-test-hook-agent-edits/</guid><description>&lt;p&gt;The agent edits a file, then edits another, then starts on a third. Somewhere in that sequence the first edit broke a test. Nobody finds out until the agent finishes its turn and runs the suite itself, if it remembers to. By then it has built two more changes on top of the broken one.&lt;/p&gt;</description></item><item><title>Make your agent earn the right to fix a flaky test: a shuffle-seed harness and a commit guard</title><link>https://tokenise.rosvetic.com/posts/fix-flaky-tests-shuffle-seed-harness/</link><pubDate>Fri, 23 Oct 2026 07:09:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/fix-flaky-tests-shuffle-seed-harness/</guid><description>&lt;p&gt;A test fails in CI, passes on rerun, and somebody tells the agent to fix the flaky test. The agent reads the file, sees nothing wrong, and does the thing that makes the red go away: wraps it in a retry, adds a short sleep, or raises the timeout. CI goes green. The race is still there, now hidden behind a setting that nobody will look at again.&lt;/p&gt;</description></item><item><title>Pin a legacy function before an agent refactors it: record its outputs, then let StrykerJS grade the safety net</title><link>https://tokenise.rosvetic.com/posts/characterization-grid-stryker-before-refactor/</link><pubDate>Tue, 20 Oct 2026 07:07:00 +0000</pubDate><guid>https://tokenise.rosvetic.com/posts/characterization-grid-stryker-before-refactor/</guid><description>&lt;p&gt;A function nobody wants to touch decides what customers pay, and an agent has just been asked to tidy it. The tests are thin, the original author left in 2021, and the diff that comes back reads fine. That&amp;rsquo;s the trap. A refactor that reads fine and changes a rounding rule is the most expensive kind, because nothing fails until an invoice does.&lt;/p&gt;</description></item></channel></rss>