Skip to content
Logo
ghostry

harness

Run integrations around every test, on any Jest-compatible runner.

Wrap your runner's describe and it once. Every test then runs inside the integrations you configured, and gets what they provide as its first argument.

npm install @ghostry/harness
import { , type  } from "@ghostry/harness";
import * as  from "bun:test";
import { ,  } from "node:fs/promises";
import {  } from "node:os";
import {  } from "node:path";
 
// Every test gets a fresh directory, removed when the test settles.
const : <{ : string }, string> = {
  : "temp directory",
  : { : ({  }) =>  },
  async *() {
    const  = await (((), "test-"));
    try {
      yield () => ();
    } finally {
      await (, { : true });
    }
  },
};
 
export const { , ,  } = ({
  ,
  : [],
});
 
("config", () => {
  ("writes to its own directory", async ({ dirArrow
}) => {
().("test-"); }); });