New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fava

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fava

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

latest
Source
npmnpm
Version
0.3.5
Version published
Weekly downloads
218
66.41%
Maintainers
1
Weekly downloads
 
Created
Source

Fava's logo

Fava (WIP)

A wannabe tiny largely-drop-in replacement for 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

npm install --save-dev fava

Usage

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.

Testimonials

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

License

MIT © Fabio Spampinato

Keywords

test

FAQs

Package last updated on 31 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts