fix deprecated pkg/test function usage
diff --git a/pubspec.yaml b/pubspec.yaml
index daeedc7..4c2325f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -24,7 +24,7 @@
benchmark_harness: '>=1.0.0 <2.0.0'
browser: any
chart: '>=1.0.8 <2.0.0'
- test: '^0.12.0'
+ test: '^0.12.18+1'
stack_trace: '>=0.9.1 <2.0.0'
environment:
sdk: ">=1.9.0 <2.0.0"
diff --git a/test/observe_test.dart b/test/observe_test.dart
index 97a92e2..ba0bf9d 100644
--- a/test/observe_test.dart
+++ b/test/observe_test.dart
@@ -93,7 +93,7 @@
});
test('handle future result', () {
- var callback = expectAsync(() {});
+ var callback = expectAsync0(() {});
return new Future(callback);
});
@@ -117,7 +117,7 @@
var t = createModel(123);
int called = 0;
- subs.add(t.changes.listen(expectAsync((records) {
+ subs.add(t.changes.listen(expectAsync1((records) {
called++;
expectPropertyChanges(records, watch ? 1 : 2);
})));
@@ -131,7 +131,7 @@
var t = createModel(123);
int called = 0;
- subs.add(t.changes.listen(expectAsync((records) {
+ subs.add(t.changes.listen(expectAsync1((records) {
called++;
expectPropertyChanges(records, 1);
if (called == 1) {
@@ -150,8 +150,8 @@
expectPropertyChanges(records, watch ? 1 : 2);
}
- subs.add(t.changes.listen(expectAsync(verifyRecords)));
- subs.add(t.changes.listen(expectAsync(verifyRecords)));
+ subs.add(t.changes.listen(expectAsync1(verifyRecords)));
+ subs.add(t.changes.listen(expectAsync1(verifyRecords)));
t.value = 41;
t.value = 42;
@@ -185,7 +185,7 @@
test('cancel listening', () {
var t = createModel(123);
var sub;
- sub = t.changes.listen(expectAsync((records) {
+ sub = t.changes.listen(expectAsync1((records) {
expectPropertyChanges(records, 1);
sub.cancel();
t.value = 777;
@@ -197,12 +197,12 @@
test('cancel and reobserve', () {
var t = createModel(123);
var sub;
- sub = t.changes.listen(expectAsync((records) {
+ sub = t.changes.listen(expectAsync1((records) {
expectPropertyChanges(records, 1);
sub.cancel();
scheduleMicrotask(() {
- subs.add(t.changes.listen(expectAsync((records) {
+ subs.add(t.changes.listen(expectAsync1((records) {
expectPropertyChanges(records, 1);
})));
t.value = 777;
diff --git a/test/path_observer_test.dart b/test/path_observer_test.dart
index bc7731a..db8037d 100644
--- a/test/path_observer_test.dart
+++ b/test/path_observer_test.dart
@@ -101,7 +101,8 @@
test('objects with toString are not supported', () {
// Dart note: this was intentionally not ported. See path_observer.dart.
- expect(() => new PropertyPath([new Foo('a'), new Foo('b')]), throws);
+ expect(() => new PropertyPath([new Foo('a'), new Foo('b')]),
+ throwsArgumentError);
});
test('invalid path returns null value', () {
@@ -293,7 +294,7 @@
test('Path Value With Indices', () {
var model = toObservable([]);
var path = new PathObserver(model, '[0]');
- path.open(expectAsync((x) {
+ path.open(expectAsync1((x) {
expect(path.value, 123);
expect(x, 123);
}));
@@ -306,7 +307,7 @@
var path = new PathObserver(model, 'isNotEmpty');
expect(path.value, false);
- path.open(expectAsync((_) {
+ path.open(expectAsync1((_) {
expect(path.value, true);
}));
model.add(123);
@@ -317,7 +318,7 @@
var path = new PathObserver(model, 'isEmpty');
expect(path.value, true);
- path.open(expectAsync((_) {
+ path.open(expectAsync1((_) {
expect(path.value, false);
}));
model.add(123);