Skip to content

Instantly share code, notes, and snippets.

@yongjhih
Created June 16, 2022 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yongjhih/b345698d36c9b4d65abe549d16311711 to your computer and use it in GitHub Desktop.
Save yongjhih/b345698d36c9b4d65abe549d16311711 to your computer and use it in GitHub Desktop.
test("lazy", () async {
final now = DateTime.now();
late final DateTime lazyNow = () {
return DateTime.now();
}();
await 2.seconds.delayed();
expect(lazyNow.difference(now) > 2.seconds, isTrue);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment