Skip to content

Conversation

@felangel
Copy link
Owner

Status

READY

Breaking Changes

NO

Description

If an uncaught error occurs within a bloc, cubit, or within the blocTest they are currently being swallowed by default which makes it very difficult to debug. Instead of swallowing uncaught errors, this change rethrows uncaught errors so that it is clear that an exception has occurred during the blocTest.

If errors is not null, uncaught errors will be aggregated and evaluated against the errors matcher.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@felangel felangel added bug Something isn't working pkg:bloc_test This issue is related to the bloc_test package labels Dec 16, 2021
@felangel felangel self-assigned this Dec 16, 2021
@codecov
Copy link

codecov bot commented Dec 16, 2021

Codecov Report

Merging #3070 (858bbca) into master (d61220c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #3070   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8        11    +3     
  Lines          192       268   +76     
=========================================
+ Hits           192       268   +76     
Impacted Files Coverage Δ
packages/bloc_test/lib/src/bloc_test.dart 100.00% <100.00%> (ø)
packages/bloc_test/lib/src/mock_bloc.dart 100.00% <0.00%> (ø)
packages/bloc_test/lib/src/when_listen.dart 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d61220c...858bbca. Read the comment docs.

@felangel
Copy link
Owner Author

cc @orestesgaolin

Copy link
Collaborator

@jeroen-meijer jeroen-meijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice :shipit:

@orestesgaolin
Copy link

👍

@felangel felangel merged commit 9b037c5 into master Dec 18, 2021
@felangel felangel deleted the fix/bloc-test-throw-uncaught-exceptions branch December 18, 2021 16:39
@felangel felangel mentioned this pull request Dec 29, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pkg:bloc_test This issue is related to the bloc_test package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: [bloc_test] Incorrect error message when exception occurs in "act"

4 participants