# fava

> A wannabe tiny largely-drop-in replacement for ava that works in the browser too.

Latest version **0.3.5** (published 2025-05-31) · 0 weekly downloads

## Install

```sh
npm install fava
pnpm add fava
yarn add fava
bun add fava
```

Provides the command `fava`.

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2025-05-31 |
| First published | 2021-07-15 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 204.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Maintainers | fabiospampinato |
| Keywords | test, tests, testing, framework, bdd, tdd, simple, tiny, small, browser, isomorphic |

## Links

- npm: https://www.npmjs.com/package/fava
- Repository: https://github.com/fabiospampinato/fava
- Homepage: https://github.com/fabiospampinato/fava#readme
- Issues: https://github.com/fabiospampinato/fava/issues
- npm.io page: https://npm.io/package/fava

## Dependencies (9)

- [watcher](https://npm.io/package/watcher.md) ^2.3.0
- [specialist](https://npm.io/package/specialist.md) ^1.3.0
- [zeptomatch](https://npm.io/package/zeptomatch.md) ^1.1.3
- [tiny-colors](https://npm.io/package/tiny-colors.md) ^2.1.2
- [call-chainer](https://npm.io/package/call-chainer.md) ^3.0.0
- [tiny-readdir](https://npm.io/package/tiny-readdir.md) ^2.2.0
- [are-deeply-equal](https://npm.io/package/are-deeply-equal.md) ^1.0.2
- [promise-make-naked](https://npm.io/package/promise-make-naked.md) ^2.0.0
- [promise-resolve-timeout](https://npm.io/package/promise-resolve-timeout.md) ^2.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.3.5 (latest) — 2025-05-31
- 0.3.4 — 2024-06-30
- 0.3.3 — 2024-06-30
- 0.3.2 — 2024-01-07
- 0.3.1 — 2023-08-25
- 0.3.0 — 2023-08-19
- 0.2.1 — 2023-08-04
- 0.2.0 — 2023-02-15
- 0.1.2 — 2023-02-13
- 0.1.1 — 2023-02-12
- 0.1.0 — 2023-02-10
- 0.0.8 — 2023-01-28
- 0.0.7 — 2022-11-15
- 0.0.6 — 2022-04-05
- 0.0.5 — 2022-03-21
- … 4 more at https://npm.io/package/fava/versions

## README

<p align="center">
  <img src="./resources/logo/logo.svg" alt="Fava's logo" width="300" />
</p>

# [Fava](https://en.wikipedia.org/wiki/Vicia_faba) (WIP)

A wannabe tiny largely-drop-in replacement for [`ava`](https://github.com/avajs/ava) that works in the browser too.

## Features

- **`ava`-like**: if you like `ava`'s APIs you'll like `fava`'s too, because it provides essentially the same APIs.
- **Tiny**: it requires about 90% fewer dependencies, that's ~8MB less code to download and execute, and most of the dependencies used I maintain myself.
- **Isomorphic**: it works everywhere, Node CLI, Node runtime, Electron, Browser, maybe even Deno.

## Drawbacks

This is still very much a work in progress, compared to `ava` it currently has the following drawbacks (and probably more):

- It's **untested**, testing software with an untested testing framework isn't really recommended.
- Tests are always run serially, even across multiple test files, no two tests are ever running at the same time.
- Test files are not preprocessed with Babel or TypeScript, they are just plain JS files.
- The textual output of the library is pretty bare-bones in general, it's pretty far from being as nice as `ava`'s.
- Error outputs in particular are pretty basic, no fancy diffs.
- The `snapshot` and `try` assertions are not implemented.
- Observables are not supported.
- TAP reporters are not supported.
- Callback tests are not supported.
- Coverage reports are not supported.

Basically unless you want to play with this or you absolutely need an `ava`-like testing framework in the browser I wouldn't recommend using this.

## Install

```sh
npm install --save-dev fava
```

## Usage

```ts
import {assert, test, describe, suite} from 'fava';

// A standalone assertion library is provided

assert.deepEqual ( [1], [1] );

// A "suite" function is provided, for opt-in better code organization
// You can totally just not use it at all

suite ( 'Example suite', describe => {

  // A "describe" function is provided, for opt-in better code organization
  // "describe" functions can be nested indefinitely
  // You can totally just not use it at all

  describe ( 'Example describe', test => {

    // A "test" function is provided, it should work just like ava's

    test ( 'Example test', t => {

      // A "t" context object is provided, it should work just like ava's

      t.pass ();

    });

  });

});
```

For further documentation for now just refer to [`ava`'s](https://github.com/avajs/ava).

## Testimonials

- `@liquid`: I have used Fava and it's bean a pleasure.

## License

MIT © Fabio Spampinato

---
_Source: https://npm.io/package/fava · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
