olexale / bdd_widget_test

A BDD-style widget testing library
MIT License
101 stars 30 forks source link

runAsync option? #37

Closed psovit closed 1 year ago

psovit commented 1 year ago

Is there a way to use tester.runAsync(() async { .... }); option with this package using code-generation?

olexale commented 1 year ago

You may write something like this in a step implementation:

await tester.runAsync<void>(() => Future.delayed(Duration(seconds: 5)));

Is it something you want to achieve with tester.runAsync?

psovit commented 1 year ago

Actually I wanted to see if the whole scenario can be wrapped around tester.runAsync and not just an individual step.

olexale commented 1 year ago

You can not wrap the whole scenario, but most probably, that's not what you need. You can use tester.runAsync in steps, and that should do. Do you have an example where it will not work?

psovit commented 1 year ago

Yeah, I managed to organize my code/test to avoid having to use tester.runAsync in scenario. Thanks :)