guys. Do you know how to join 2 different assertions?
assert.isNotNull(res.body, "is not null");
assert.isNotNull(res.body.createdAt, "is not null");
ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
Wrap your assertion in a Promise.all
Promise.all([
assert.isNotNull(res.body, "is not null"),
assert.isNotNull(res.body.createdAt, "is not null")
])
You pass an array of assertions. Both will have to pass in order to pass the assertion.
You can use the expect chai assertion along with &&, something like:
expect(res.body).to.not.be.null && expect(res.body.createdAt).to.not.be.null