javascriptesmtestingmockingESM is supposed to be the future of JavaScript, but writing tests for ESM code can still be a huge pain because of one problem: Mocking. I've found an easy way to make ESM mocking <em>just work</em>.
javascripttypescriptThe first major stumble I had while learning TS was how to create useful anonymous types for massaged data. The answer turns out to be really simple and once you know the technique the error message is a useful reminder.