Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Mar 14, 2024
1 parent a7d30f5 commit 367649c
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ void main() {

expect(container.read(provider.future), future);

// TODO(rrousselGit) test that the stacktrace is preserved
await expectLater(future, throwsA(error));
expect(await future.stackTrace, StackTrace.empty);

final error2 = Error();

Expand Down Expand Up @@ -476,8 +476,8 @@ void main() {

expect(container.read(provider.future), future);

// TODO(rrousselGit) test that the stacktrace is preserved
await expectLater(future, throwsA(error));
expect(await future.stackTrace, StackTrace.empty);

final error2 = Error();

Expand All @@ -488,8 +488,8 @@ void main() {

future = container.read(provider.future);

// TODO(rrousselGit) test that the stacktrace is preserved
await expectLater(future, throwsA(error2));
expect(await future.stackTrace, StackTrace.empty);
});

test('supports loading then data then loading', () async {
Expand Down Expand Up @@ -925,3 +925,14 @@ void main() {
});
});
}

extension on Future<Object?> {
Future<StackTrace?> get stackTrace async {
try {
await this;
return null;
} catch (e, s) {
return s;
}
}
}

0 comments on commit 367649c

Please sign in to comment.