The Test Runner with the Shortest Time to Takeoff
flug is "flight" in German
- Only One Assertion Function
- Easy Startup
- Works in Browser and NodeJS
- Light Weight (~4KB)
- Sane Defaults
- Zero Dependencies
- Fixed Order
- Async Support
- Simple By Design
- Exit on First Failure (NodeJS Only)
- TypeScript Support
There's a lot of awesome assertions libraries out there with a lot of awesome assertion functions. But the reality is that I have struggled to remember all the names of the assertion functions. Is it t.eq
or t.is
? Is it deepStrictEqual
or strictDeepEqual
? I needed a simpler, more memorable testing inteface, so I built Flug.
Flug exposes only one assertion function eq
, which does deep equality checking. This solves 99.9% of my use cases, so that's good enough.
- not designed for large libraries with hundreds of tests
You can read more about advanced features here.
npm install flug
const test = require("flug");
// simple sync usage
test("addition", ({ eq }) => {
eq(1 + 1, 2);
});
// simple async usage
test("sleep", async ({ eq }) => {
await sleep(5);
eq(1 + 1, 2);
});
<script src="https://unpkg.com/flug"></script>
<script>
const { test } = flug;
test("addition", ({ eq }) => {
eq(1 + 1, 2);
});
</script>