npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fava

v0.3.2

Published

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

Downloads

136

Readme

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