I have couple line of code to use chai library but I get this error Expected an assignment or function call and instead saw an expression on expect(validTime(t)).to.be.true; anyone know why or how to fix it?
function validTime(timestamp) {
const utcnow = moment.utc().unix();
if (utcnow > timestamp) {
return true;
}
return false;
}
describe('test time function', () => {
it('given time should work', () => {
const t = moment.utc().unix();
expect(validTime(t)).to.be.true;
});
});