Skip to content

Replace most toBeTruthy()/toBeFalsy() matchers with more specific ones in the unit-tests - #21739

Merged
Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:test-replace-most-toBeTruthy-toBeFalsy
Aug 9, 2026
Merged

Replace most toBeTruthy()/toBeFalsy() matchers with more specific ones in the unit-tests#21739
Snuffleupagus merged 1 commit into
mozilla:masterfrom
Snuffleupagus:test-replace-most-toBeTruthy-toBeFalsy

Conversation

@Snuffleupagus

@Snuffleupagus Snuffleupagus commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Generally speaking it seems like a good idea to have the unit-tests be explicit about their expected values, rather than accepting "arbitrary" truthy/falsy values.

@codecov-commenter

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (99df11c) to head (963bd50).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21739   +/-   ##
=======================================
  Coverage   90.07%   90.07%           
=======================================
  Files         264      264           
  Lines       67190    67190           
=======================================
+ Hits        60519    60521    +2     
+ Misses       6671     6669    -2     
Flag Coverage Δ
unittest 58.25% <ø> (+<0.01%) ⬆️
unittestcli 56.61% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

r=me, with the merge conflict fixed. This seems better indeed.

… ones in the unit-tests

Generally speaking it seems like a good idea to have the unit-tests be *explicit* about their expected values, rather than accepting "arbitrary" truthy/falsy values.
@Snuffleupagus
Snuffleupagus force-pushed the test-replace-most-toBeTruthy-toBeFalsy branch from d9166ae to 963bd50 Compare August 9, 2026 18:04
@Snuffleupagus
Snuffleupagus merged commit 78cf296 into mozilla:master Aug 9, 2026
12 checks passed
@Snuffleupagus
Snuffleupagus deleted the test-replace-most-toBeTruthy-toBeFalsy branch August 9, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants