lorenzofox3 / zora-node

test runner for nodejs using zora testing library
MIT License
27 stars 3 forks source link

Add timeout option #14

Open mohd-akram opened 3 years ago

mohd-akram commented 3 years ago

This would be helpful to catch promises that don't resolve, or that take too long to resolve. An example of a test that currently "succeeds" despite not completing:

module.exports = async (t) => {
  const x = await new Promise(() => {});
  t.equal(x, 2);
};
lorenzofox3 commented 3 years ago

Thanks for the feedback, I think this issue would be more appropriate in zora'repository

mohd-akram commented 3 years ago

I wasn't quite sure tbh, but node-tap provides a -t timeout option in the CLI and I'm looking for something like that. I'd rather not have to set an explicit timeout for every test.

lorenzofox3 commented 3 years ago

I see, then we might want tackle it in both repositories 👍 . I'll get a look over the week end.