Wondering what’s next for npm?Check out our public roadmap! »

This package has been deprecated

Author message:

Postman now has BDD tests and fluent syntax built-in, so Postman-BDD is no longer necessary


5.0.7 • Public • Published

Postman BDD

✨ Postman now has it's own BDD test syntax ✨

Postman-BDD is no longer necessary, because Postman now has its own BDD and fluent syntax built-in!

I recommend that you start using Postman's new test syntax instead of Postman-BDD. However, if you want to continue using Postman-BDD, then you can find the original ReadMe here.



// example using pm.response.to.have
pm.test("response is ok", () => {
// example using pm.expect()
pm.test("environment to be production", () => {
// example using response assertions
pm.test("response should be okay to process", () => {
// example using pm.response.to.be*
pm.test("response must be valid and have a body", () => {
     // assert that the status code is 200
     pm.response.to.be.ok; // info, success, redirection, clientError,  serverError, are other variants
     // assert that the response has a valid JSON body
     pm.response.to.be.json; // this assertion also checks if a body  exists, so the above check is not needed

Migration Guide

Postman's new BDD and fluent syntax are a bit different from Postman-BDD. Here are the changes you need to make to migrate your tests:

Remove describe blocks

describe() blocks were optional in Postman-BDD, and they don't exist at all in Postman's new syntax. So just remove them.

Replace it blocks with pm.test

Postman-BDD used it blocks to define tests, such as:

it('should return the correct customer', () => {
  // assertions here

Postman now has pm.test blocks, which work the same way. For example:

pm.test('returns the correct customer', () => {
  // assertions here

Move hooks to folder/collection scripts

Postman-BDD allowed you to define common assertions or setup/teardown logic in hooks, such as before(), after(), beforeEach() and afterEach(). This is no longer necessary because Postman now allows you to define test scripts for folders and collections.

Different assertion syntax

Postman-BDD used the Chai.js and Chai-HTTP assertion libraries, which let you write assertions using an intuitive, fluent, English-like syntax.

it('should return a 200 response', () => {
it('should set the Location header', () => {
it('should return a JSON response', () => {
it('should return the correct customer', () => {
  response.body.should.have.property('id', 12345);

Postman now supports its own fluent assertion syntax, which is somewhat similar.

pm.test('returns a 200 response', () => {
pm.test('sets the Location header', () => {
pm.test('returns a JSON response', () => {
pm.test('returns the correct customer', () => {
  let jsonData = pm.response.json();


npm i postman-bdd

DownloadsWeekly Downloads






Unpacked Size

46.2 kB

Total Files


Last publish


  • avatar
  • avatar