jest-runner-newman
A Jest runner for Postman's Newman CLI tool
Last updated 2 years ago by larrybotha .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jest-runner-newman 
SYNC missed versions from official npm registry.

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

Purpose

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

Install

$ 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 = 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

Current Tags

  • 1.0.5                                ...           latest (2 years ago)

8 Versions

  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0-development                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |