# @backstage/backend-test-utils

> Test helpers library for Backstage backends

Latest version **1.11.7** (published 2026-09-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @backstage/backend-test-utils
pnpm add @backstage/backend-test-utils
yarn add @backstage/backend-test-utils
bun add @backstage/backend-test-utils
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.11.7 |
| Published | 2026-09-15 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 31 |
| Unpacked size | 567 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34428 |
| Maintainers | patriko, freben, marcuseide |
| Keywords | backstage, test |

## Links

- npm: https://www.npmjs.com/package/@backstage/backend-test-utils
- Repository: https://github.com/backstage/backstage
- Homepage: https://backstage.io
- npm.io page: https://npm.io/package/@backstage/backend-test-utils

## Dependencies (31)

- [pg](https://npm.io/package/pg.md) ^8.11.3
- [yn](https://npm.io/package/yn.md) ^4.0.0
- [zod](https://npm.io/package/zod.md) ^3.25.76 || ^4.0.0
- [keyv](https://npm.io/package/keyv.md) ^5.2.1
- [knex](https://npm.io/package/knex.md) ^3.0.0
- [cookie](https://npm.io/package/cookie.md) ^0.7.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [mysql2](https://npm.io/package/mysql2.md) ^3.0.0
- [express](https://npm.io/package/express.md) ^4.22.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.0.0
- [@types/qs](https://npm.io/package/@types/qs.md) ^6.9.6
- [@keyv/redis](https://npm.io/package/@keyv/redis.md) ^4.0.1
- [@types/keyv](https://npm.io/package/@types/keyv.md) ^4.2.0
- [@keyv/valkey](https://npm.io/package/@keyv/valkey.md) ^1.0.1
- [@keyv/memcache](https://npm.io/package/@keyv/memcache.md) ^2.0.1
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.6
- [better-sqlite3](https://npm.io/package/better-sqlite3.md) ^12.0.0
- [testcontainers](https://npm.io/package/testcontainers.md) ^11.9.0
- [text-extensions](https://npm.io/package/text-extensions.md) ^2.4.0
- [@backstage/types](https://npm.io/package/@backstage/types.md) ^1.2.2
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^1.3.9
- [@backstage/errors](https://npm.io/package/@backstage/errors.md) ^1.3.1
- [zod-to-json-schema](https://npm.io/package/zod-to-json-schema.md) ^3.25.1
- [pg-connection-string](https://npm.io/package/pg-connection-string.md) ^2.3.0
- [@backstage/backend-app-api](https://npm.io/package/@backstage/backend-app-api.md) ^1.7.4
- [@backstage/backend-defaults](https://npm.io/package/@backstage/backend-defaults.md) ^0.18.0
- [@backstage/plugin-auth-node](https://npm.io/package/@backstage/plugin-auth-node.md) ^0.7.6
- [@backstage/backend-plugin-api](https://npm.io/package/@backstage/backend-plugin-api.md) ^1.10.1
- [@backstage/plugin-events-node](https://npm.io/package/@backstage/plugin-events-node.md) ^0.4.26
- [@types/express-serve-static-core](https://npm.io/package/@types/express-serve-static-core.md) ^4.17.5
- [@backstage/plugin-permission-common](https://npm.io/package/@backstage/plugin-permission-common.md) ^0.9.11

## 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
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.11.7 (latest) — 2026-09-15
- 0.0.0-nightly-20260909022715 (nightly) — 2026-09-09
- 1.11.7-next.1 (next) — 2026-09-08
- 0.0.0-nightly-20260904022803 — 2026-09-04
- 0.0.0-nightly-20260902024315 — 2026-09-02
- 1.11.7-next.0 — 2026-09-01
- 0.0.0-nightly-20260829022506 — 2026-08-29
- 0.0.0-nightly-20260828045505 — 2026-08-28
- 0.0.0-nightly-20260827035829 — 2026-08-27
- 1.11.6 — 2026-08-18
- 0.0.0-nightly-20260818023149 — 2026-08-18
- 0.0.0-nightly-20260817023522 — 2026-08-17
- 0.0.0-nightly-20260816023538 — 2026-08-16
- 0.0.0-nightly-20260815023121 — 2026-08-15
- 0.0.0-nightly-20260814030239 — 2026-08-14
- … 1715 more at https://npm.io/package/@backstage/backend-test-utils/versions

## README

# @backstage/backend-test-utils

Test helpers library for Backstage backends.

## Usage

Add the library as a `devDependency` to your backend package:

```sh
# From your Backstage root directory, go to your backend package, or to a backend plugin
cd plugins/my-plugin-backend
yarn add --dev @backstage/backend-test-utils
```

## Environment variables

- `BACKSTAGE_TEST_DISABLE_DOCKER`
  - Setting the value to `1` disables Docker for tests
- `CI`
  - Setting the value to `1` enables long-running tests, including the ones utilizing Docker
- `BACKSTAGE_TEST_DOCKER_REGISTRY`
  - Docker registry mirror address where to pull images for tests, for example `mycompany.docker.io/mirror`
  - See [documentation](https://node.testcontainers.org/configuration/) for information
    about authentication (`DOCKER_AUTH_CONFIG`)

Connection strings for different databases that are used for testing. The value of the
string should point to the running instance of the database.

- `BACKSTAGE_TEST_DATABASE_POSTGRES13_CONNECTION_STRING`
- `BACKSTAGE_TEST_DATABASE_POSTGRES12_CONNECTION_STRING`
- `BACKSTAGE_TEST_DATABASE_POSTGRES11_CONNECTION_STRING`
- `BACKSTAGE_TEST_DATABASE_POSTGRES9_CONNECTION_STRING`
- `BACKSTAGE_TEST_DATABASE_MYSQL8_CONNECTION_STRING`

## Documentation

- [Backstage Readme](https://github.com/backstage/backstage/blob/master/README.md)
- [Backstage Documentation](https://backstage.io/docs)

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