BDD with async tests
I'd like to run some tests that all call the same helper function that wraps the bdd
it
function.
Something like this:
It works with a non-async version but I'd like to know how to do this in a async way.2 Replies
Based on the documentation, Deno's built-in test runner supports both synchronous and asynchronous tests. However, the
describe
and it
functions you're using are not part of Deno's built-in testing tools. They are commonly used in JavaScript testing libraries like Mocha or Jasmine.
In Deno, you would use Deno.test
to define a test. If your test function is asynchronous, the test runner will await its resolution to consider the test complete. Here's how you might write your tests in Deno:
Each call to test
creates a new test case that will be run when you use deno test
on the command line. The test function can be async, and Deno will automatically handle awaiting its resolution.
Please note that this information is based on the Deno documentation and may not apply if you're using a different testing library or framework.Sorry but this AI is stupid, I am asking about the funciton in the deno std