A Jest runner for Postman's Newman CLI tool

Usage no npm install needed!

<script type="module">
  import jestRunnerNewman from '';


Jest Runner Newman

Build Status npm version

A Jest runner for Postman's Newman CLI tool.

Table of Contents

cli example of jest-runner-newman


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


$ npm install -D jest-runner-newman
# jest.newman.js

module.exports = {
  displayName: 'newman',
  testMatch: ['<rootDir>/path/to/tests/**.test.js'],
  runner: 'jest-runner-newman',
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:

# my-collection.test.js

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

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

  // anything else you want