I want if the await function can execute while the condition is true, the test will be fail and throw the error 'can claim'. And if await function cannot execute, the test will be throw to catch and the test is pass. Thank you!
it('do something', async () => {
try{
await pool.methods.claim().send({
from: accounts[2]
})
if(Date.now() / 1000 < endTime){
assert.fail(new TypeError('can claim'));
}
}
catch(e){
assert(true);
}
});