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

haibun

v1.34.0

Published

[![Haibun unit tests](https://github.com/withhaibun/haibun/actions/workflows/test.yml/badge.svg)](https://github.com/withhaibun/haibun/actions/workflows/test.yml)

Downloads

43

Readme

Haibun unit tests

haibun

Haibun is inspired by the literary form that combines descriptive and objective prose with haiku.

This package is intended to enable specification driven development, with end to end tests. This type of development is often tedious to develop, brittle to changing underlying implementations, difficult to maintain, and isolated from general specifications. While @Haibun may not make this development fun, it is intended to make it easier to maintain, with an emphasis on reuse for different deployment environments, and the ability to link to formal specifications.

Conceptually, there are three "layers" to Haibun:

  • A BDD-like layer, with testable descriptions of flows in a project features in plain language
  • A domain layer, with abstract representations of functionality & data, for example, the Web
  • An implementation layer, where specific testers are written, for example, tests in a Web browser.

Haibun encourages small libraries with minimal, precisely versioned dependencies, and provides abstract definitions of storage and other testing features, so specifications and tests can be developed in a way that's not dependant on any implementation or vendor.

Haibun also encourages creating testing modules and reusable flows, so each new project requires less original code, and contributes to existing modules and flows.

See the modules directory, and other repos under the withhaibun org.

Use in libraries

Normally, libraries from this repository will be included in a project like any other, or used via the cli, for example, using npx @haibun/cli.

Easily add Haibun to an existing library using scaffolding

Command line interface

haibun can be used as a library or via the cli. To see a list of cli option for a particular set of features, use --help along with the feature folder. For example, in the haibun-e2e-tests repository, use this command to see available options:

npx @haibun/cli --help local

Further Documentation

Development & Debugging help

When using storage-mem in tests, it may be helpful to use vi.spyOn(process, 'cwd').mockReturnValue('/');

It can be handy to access the memfs directoy; use this: (this.publishStorage as any).debug(${publishRoot}/tracks/`);``

A few test steppers are provided, such as SetTimeStepper, from '@haibun/core/build/lib/test/SetTimeStepper.js'.