# jest-runner-newman

> A Jest runner for Postman's Newman CLI tool

Latest version **1.0.5** (published 2018-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-runner-newman
pnpm add jest-runner-newman
yarn add jest-runner-newman
bun add jest-runner-newman
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-12-25 |
| First published | 2018-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | larrybotha |
| Keywords | jest, jest-runner, postman, newman |

## Links

- npm: https://www.npmjs.com/package/jest-runner-newman
- Repository: https://github.com/fixate/jest-runner-newman
- Homepage: https://github.com/fixate/jest-runner-newman#readme
- Issues: https://github.com/fixate/jest-runner-newman/issues
- npm.io page: https://npm.io/package/jest-runner-newman

## Dependencies (1)

- [create-jest-runner](https://npm.io/package/create-jest-runner.md) 0.4.1

## Recent versions

- 1.0.5 (latest) — 2018-12-25
- 1.0.4 — 2018-12-25
- 1.0.3 — 2018-12-24
- 1.0.2 — 2018-12-24
- 1.0.1 — 2018-12-24
- 1.0.0 — 2018-12-24
- 0.0.1 — 2018-12-24
- 0.0.0-development — 2018-12-24

## README

# Jest Runner Newman

[![Build Status](https://travis-ci.org/fixate/jest-runner-newman.svg?branch=master)](https://travis-ci.org/fixate/jest-runner-newman)
[![npm version](https://badge.fury.io/js/jest-runner-newman.svg)](https://badge.fury.io/js/jest-runner-newman)

A Jest runner for Postman's [Newman](https://github.com/postmanlabs/newman) CLI tool.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Purpose](#purpose)
- [Install](#install)
- [Running tests](#running-tests)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

<img src="assets/jest-runner-newman-demo.gif" alt="cli example of jest-runner-newman">

## Purpose

Easily run automated tests for your Postman collections using Newman and Jest.

## Install

```bash
$ npm install -D jest-runner-newman
```

```javascript
# jest.newman.js

module.exports = {
  displayName: 'newman',
  testMatch: ['<rootDir>/path/to/tests/**.test.js'],
  runner: 'jest-runner-newman',
}
```

```bash
npx jest -c jest.newman.js
```

## Running tests

`jest-runner-newman` runs Newman tests in Node child processes. In addition to
running a Newman test via the `newman` module, each test needs to send the
parent process the result of the test run. To make this easier,
`jest-runner-newman` exports a separate module to specifically handle that:

```javascript
# my-collection.test.js

const {handleResult} = require('jest-runner-newman/handle-result')
const newman = require('newman');

module.exports = newman.run({
  collection: `[collection-url]`,
  environment: `[envinroment-url]`,
  reporters: ['cli'],
  // any other newman configs
}, (err, result) => {
  handleResult(err, result);

  // anything else you want
})
```

## License

MIT

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