29
  it('GET /customers/ with wrong id', (done) => {
    request
      .get(`/customers/${wrongId}`)
      .end((err, res) => {
        expect(res.body).to.equals({});
        expect(res).to.have.status(404);
        done();
      });
  });

1) Customers CRUD GET /customers/ with wrong id:

  Uncaught AssertionError: expected {} to equal {}
  + expected - actual
Limarenko Denis
  • 769
  • 1
  • 8
  • 13

1 Answers1

61

You want to use deep if you're trying to compare objects:

expect(res.body).to.deep.equal({});

Or use the eql method:

expect(res.body).to.eql({});
robertklep
  • 198,204
  • 35
  • 394
  • 381