'Natalie Weizenbaum' via Dart Misc
2016-12-02 00:44:34 UTC
Hi Dartisans,
A couple days go, I released test 0.12.17. This version introduces a change
to how asynchronous callbacks in tests are handled. In particular, *the
expectAsync() and expectAsyncUntil() functions are now deprecated.* In
their place are a family of functions that explicitly mention the number of
arguments in the callback: expectAsync0(() => ...), expectAsync1((arg) =>
...), expectAsync2((arg1, arg2) => ...), and so on.
"But Natalie," I hear you say, "isn't that just more work for me to do?"
Well... yes. It's a usability regression, and I'm not happy about that. But
in exchange for that regression, *you now have the ability to make all your
tests strong-mode clean*. The old expectAsync() functions were incompatible
with strong mode, for reasons that you can read about if you really want
<https://github.com/dart-lang/sdk/issues/26420>. The new ones are
compatible, which means you get better error checking as well as the
ability to compile your tests with DDC. Hooray!
What's more, this is only a temporary usability hit. Two major features
under consideration for Dart 2.0, union types
<https://github.com/dart-lang/sdk/issues/4938> and overloads
<https://github.com/dart-lang/sdk/issues/26488>, would each independently
make it possible to ditch the digits and go back to the old API. But in
order to get to that world, we have to get everything strong-mode clean,
and this is an important step.
So go forth and enjoy a newer, stronger world!
P.S. Shout-out to Florian Loitsch who added the new functions to test!
A couple days go, I released test 0.12.17. This version introduces a change
to how asynchronous callbacks in tests are handled. In particular, *the
expectAsync() and expectAsyncUntil() functions are now deprecated.* In
their place are a family of functions that explicitly mention the number of
arguments in the callback: expectAsync0(() => ...), expectAsync1((arg) =>
...), expectAsync2((arg1, arg2) => ...), and so on.
"But Natalie," I hear you say, "isn't that just more work for me to do?"
Well... yes. It's a usability regression, and I'm not happy about that. But
in exchange for that regression, *you now have the ability to make all your
tests strong-mode clean*. The old expectAsync() functions were incompatible
with strong mode, for reasons that you can read about if you really want
<https://github.com/dart-lang/sdk/issues/26420>. The new ones are
compatible, which means you get better error checking as well as the
ability to compile your tests with DDC. Hooray!
What's more, this is only a temporary usability hit. Two major features
under consideration for Dart 2.0, union types
<https://github.com/dart-lang/sdk/issues/4938> and overloads
<https://github.com/dart-lang/sdk/issues/26488>, would each independently
make it possible to ditch the digits and go back to the old API. But in
order to get to that world, we have to get everything strong-mode clean,
and this is an important step.
So go forth and enjoy a newer, stronger world!
P.S. Shout-out to Florian Loitsch who added the new functions to test!
--
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
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
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
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.