You need to check a date using Chai. You also need to account for the test execution time.

Compare the milliseconds using Chai’s closeTo method.

const updatedAt = new Date()

// Some time later...

expect(updatedAt.getTime()).to.be.closeTo(Date.now(), 100)

The second closeTo parameter controls the delta; the largest acceptable difference between the two values.