0.3.2 • Published 4 months ago

fava v0.3.2

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

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

0.3.2

4 months ago

0.3.0

9 months ago

0.3.1

9 months ago

0.2.1

9 months ago

0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago