At we love writing as little code as possible, so we decided to combine our unit tests with same JSDoc comments that power VSCode's IntelliSense. Supabase Intro to JSDoc If you've never heard of before, you've probably seen it. It's the comments that go above a Javascript method or class like this: JSDoc sum = { a + b } /** * Returns the sum of 2 numbers * @param {number} a The first number * @param {number} b The second number */ export const ( ) => a, b return The @example tag JSDoc has a tag, , which shows a developer how to use a documented item. @example sum = { a + b } /** * Returns the sum of 2 numbers * @param {number} a The first number * @param {number} b The second number * @example * // returns 3 * sum(1, 2) */ export const ( ) => a, b return Although the structure is a bit different, this is very similar to . Elixir has the additional benefit that you can use these comments to run your tests: Elixir's doctests "4 doctests" So we decided it would be pretty cool to implement the same functionality with Javascript: . @supabase/doctest-js Doctest-JS uses a very similar format to Elixir's Doctests, using //=> to specify return values. /** * @example sum(1, 2) * //=> 3 */ Doctest-JS If you want to try this on your own code, it's very simple: 1. Install npm install @supabase/doctest-js 2. Write @example comments Create a JSDoc style @example on any functions that you want tested. For example, create a file called and add this code: sum.js sum = { a + b } /** * Returns the sum of 2 numbers * * @example sum(1, 2) * //=> 3 */ export const ( ) => a, b return 3. Run the tests Import the doctest function in your test suite and point it at the file. For example, create a file called, and add this code: test.js doctests ; describe( , () => { doctest( ) }) import from '@supabase/doctest-js' 'Doctests' // file paths are relative to root of directory 'sum.js' And then simply run and you get well documented, tested code, without having to maintain any additional code. node test You can see it in action over at our library: postgrest-js Watch and star to keep updated about new releases. doctest-js