66
rated 0 times
[
73]
[
7]
/ answers: 1 / hits: 5464
/ 2 Years ago, wed, december 22, 2021, 12:00:00
in my test
it("should list all tickets", async () => {
const getTicket = await request(app)
.get("/v1/ticket")
.set("authorization", loginResponse.body.accessJWT);
console.log(getTicket.body.result);
console.log(getTicket.body.result[0].conversations);
expect(getTicket.body.result).toEqual(
expect.arrayContaining([
expect.objectContaining({
// _id: expect.any(String),
// status: "pending response",
openAt: expect.any(Date),
conversations: expect.arrayContaining([
expect.objectContaining({
// sender: expect.any(String),
msgAt: expect.any(String),
// message: expect.any(String),
}),
]),
}),
])
);
});
});
i am checking if the value of openAt and msgAt is a date value. But the date value is saved in the string form similar to
"msgAt": "2021-12-22T08:29:15.038Z",
How to check if the value of openAt will be a date saved in a string format?
More From » datetime