Timer.run(expectAsync((){
expect(true, equals(true));
}));I think this is wrong because the test could already have been ended before `expectAsync()` is called.I would use it like
var done = expectAsync((){});
Timer.run((){
expect(true, equals(true));
done();
}));Can the first version work?I also read several times that returning a Future from a test would make the test wait until the Future completes.This didn't work for me yet (worked for async calls in `setUp()` though)Any thoughts about this?
In async unit test I often see expectAsync used like this
Timer.run(expectAsync((){
expect(true, equals(true));
}));I think this is wrong because the test could already have been ended before `expectAsync()` is called.I would use it like
var done = expectAsync((){});
Timer.run((){
expect(true, equals(true));
done();
}));Can the first version work?
I also read several times that returning a Future from a test would make the test wait until the Future completes.This didn't work for me yet (worked for async calls in `setUp()` though)Any thoughts about this?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Timer.run(() => expectAsync(() { xxx }));