node.js - expect is not defined in supertest-as-promised -


when used bellow code error shown expect not defined (inside of )

documentation link

it("should return error", function () {   return request(app).get("/verify")     .expect(200)     .then(function (res) {       return expect(res.body.error[0].message).to.equal("new_code_required");     }); }); 

how can check this?

it's bit of oversight of documentation not mention standalone expect function isn't included in package.

for that, have use separate package, chai:

const expect = require('chai').expect; ... 

Comments