# @spartez-software/test-utils

> Spartez tests helper lib

Latest version **0.0.80** (published 2025-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @spartez-software/test-utils
pnpm add @spartez-software/test-utils
yarn add @spartez-software/test-utils
bun add @spartez-software/test-utils
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.80 |
| Published | 2025-09-09 |
| First published | 2021-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bartłomiej Zięba |
| Maintainers | aleksanderciesielski, joanna.zola, mnykiel, pdobrzanski, bzieba-spartez, szymonwalkowskispartez, sebastianmialkowski, szymon.knopp, appfire, appfireap, rytistarasevicius1, murthy_appfire, manish-appfire, matteo.castellotti |

## Links

- npm: https://www.npmjs.com/package/@spartez-software/test-utils
- Repository: https://bitbucket.org/spartez-software/spartez-test-utils
- Homepage: https://bitbucket.org/spartez-software/spartez-test-utils#readme
- npm.io page: https://npm.io/package/@spartez-software/test-utils

## Dependencies (9)

- [ora](https://npm.io/package/ora.md) 5.1.0
- [chalk](https://npm.io/package/chalk.md) 4.1.0
- [mkdirp](https://npm.io/package/mkdirp.md) 1.0.4
- [rimraf](https://npm.io/package/rimraf.md) 3.0.2
- [p-retry](https://npm.io/package/p-retry.md) 4.2.0
- [color-hash](https://npm.io/package/color-hash.md) 1.0.3
- [string-hash](https://npm.io/package/string-hash.md) 1.1.3
- [cli-truncate](https://npm.io/package/cli-truncate.md) 2.1.0
- [source-map-support](https://npm.io/package/source-map-support.md) 0.5.19

## Recent versions

- 0.0.80 (latest) — 2025-09-09
- 0.0.27 (master) — 2021-02-08
- 0.0.13-09d09c3-3139.66 (NONE_deployment-smialkowski) — 2021-02-02
- 0.0.13-b3fc855-3134.66 (dev) — 2021-02-02
- 0.0.7-e69161b-.193 (canary) — 2021-02-02
- 0.0.13-875afd9-3125.66 (TC-227_azure_agent_problem) — 2021-02-02
- 0.0.13-e822423-3123.66 (NONE_leak_test2) — 2021-02-02
- 0.0.13-0ea7093-3118.66 (NONE_windows_vm_fresh_start) — 2021-02-02
- 0.0.13-7fcaab2-3114.66 (NONE_leak_debug) — 2021-02-02
- 0.0.13-c03f92a-3016.67 (feature_TC-207-sync-start-date) — 2021-01-29
- 0.0.7-cdaed59-.189 (fix-synchronisation-smialkowski) — 2021-01-29
- 0.0.13-1244b63-2962.83 (TC-122_granular_postgress_access) — 2021-01-28
- 0.0.13-012df10-2930.67 (feature_TC-185_status_transition_with_additional_fields) — 2021-01-28
- 0.0.13-f231407-2891.65 (feature_TC-204-start-init-sync-ui) — 2021-01-27
- 0.0.7-977e456-.194 (feature/TC-204-start-init-sync-ui) — 2021-01-27
- … 166 more at https://npm.io/package/@spartez-software/test-utils/versions

## README

# `spartez test utils` (Beta)

Various test helpers - jest based

## prerequisites

* ability to run tests using jest

## installation
npm install @spartez-software/jira-test --save-dev

## Usage

### Logging

For logging inside tests it is better to use `TestLogger` from `@spartez-software/test-utils`. 
It's a wrapper around  console.log(...), but with added test context and colors.
Especially useful when running tests in parallel.

### Steps

Use **steps** from  `@spartez-software/test-utils` to divide your integration and e2e tests into sections
that can/should be retried(in case of network.* issues, external services hiccups etc) to make the test stable. 
It uses https://www.npmjs.com/package/p-retry underneth, you can pass retry options by providing optional StepOpts param.
```typescript
interface StepOpts {
    retries?: number,
    minTimeout?: number,
    maxTimeout?: number
}
```
look https://github.com/tim-kos/node-retry#retryoperationoptions for default values.

If no StepOpts are given - it defaults to  
```typescript
{ retries: 3 }
```

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