# @eeue56/bach

> A simple TypeScript test runner inspired by Pytest.

Latest version **1.0.1** (published 2026-01-31) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @eeue56/bach
pnpm add @eeue56/bach
yarn add @eeue56/bach
bun add @eeue56/bach
```

Provides the command `bach`.

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-01-31 |
| First published | 2021-03-25 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 177.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | eeue56 |
| Maintainers | eeue56 |
| Keywords | testing, pytest, hiraeth |

## Links

- npm: https://www.npmjs.com/package/@eeue56/bach
- Repository: https://github.com/eeue56/bach
- Homepage: https://github.com/eeue56/bach#readme
- Issues: https://github.com/eeue56/bach/issues
- npm.io page: https://npm.io/package/@eeue56/bach

## Dependencies (2)

- [json5](https://npm.io/package/json5.md) ^2.2.3
- [@types/node](https://npm.io/package/@types/node.md) ^22.15.21

## 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

- 1.0.1 (latest) — 2026-01-31
- 0.2.2-3 (next) — 2026-01-27
- 1.0.0 — 2026-01-27
- 0.2.2-2 — 2026-01-27
- 0.2.2-1 — 2026-01-27
- 0.2.1 — 2025-08-15
- 0.2.0 — 2025-05-25
- 0.1.2 — 2023-03-14
- 0.1.1 — 2023-03-13
- 0.1.0 — 2023-03-12
- 0.0.17-1 — 2023-03-10
- 0.0.17-0 — 2023-03-10
- 0.0.16 — 2023-03-10
- 0.0.15 — 2023-03-09
- 0.0.14 — 2023-03-05
- … 16 more at https://npm.io/package/@eeue56/bach/versions

## README

# bach

A very simple TypeScript test runner inspired by Pytest.

Looks in tsconfig.include for files ending with `test`. Look in those files for functions starting with `test`, and run them. Async functions are run with `await`. Use the [assert](https://nodejs.org/api/assert.html) module for writing assertions. The return result is ignored.

Part of the [Hiraeth](https://github.com/eeue56/hiraeth) collection.

## Installation

Requires ts-node to be installed.

```
npm install --save-dev @eeue56/bach
```

## Usage

Make sure your tsconfig has `include` set up correctly. Then you can run bach via `npx @eeue56/bach` from the project root.

See [bach_test.ts](src/bach_test.ts) for example usage.

You can also specify specific files or functions to run via flags:

```
  --function [string...]:		Run a specific function
  --file [string...]:		    Run a specific file
  --clean-exit:             Don't use process.exit even if tests fail
  --only-fails :		        Only show the tests that fail
  --in-chunks number:       Run tests in chunks of N files (suitable for lower memory impact)
  --chunk-start number:     Start running chunk at N
  -u, --update-snapshots :  Update the snapshots and exit
  -h, --help :		          Displays help message

```

## Snapshot tests

Snapshots can be created by having a function called `snapshot{x}` exported inside the test files. On first run, it will create the snapshot files in `__snapshots__`. On subsequent runs, the contents within the snapshot files will be compared with the output from the function. For example:

```typescript
export async function snapshotNumber() {
    return 9001;
}
```

## Name

Bach means "small" or "little" in Welsh. It is also used as an affectionate term, much like "love" or "dear" in English. I named it bach, because I wanted the smallest possible test runner that still gave useful output.

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