request('http://localhost:3000') .get('/api/employees') .expect(200) .expect('Content-Type', 'application/json') .expect(function(res) { if (!res.body.hasOwnProperty('name')) throw new Error("Expected 'name' key!"); if (!res.body.hasOwnProperty('city')) throw new Error("Expected 'city' key!"); }) .end(function(err, res) { if (err) throw err; });