Skip to content

fix: preserve falsy assertion expected/actual values#578

Open
Sembauke wants to merge 2 commits intofreeCodeCamp:mainfrom
Sembauke:fix/falsy-assertion-values
Open

fix: preserve falsy assertion expected/actual values#578
Sembauke wants to merge 2 commits intofreeCodeCamp:mainfrom
Sembauke:fix/falsy-assertion-values

Conversation

@Sembauke
Copy link
Copy Markdown
Member

@Sembauke Sembauke commented Mar 20, 2026

This fixes the bug where failed test messages show undefined instead of real values like 0 or false.

The issue was that error values were only included when they were "truthy". That dropped valid falsy values (0, false, and empty strings) from expected and actual.

This change keeps those values by checking whether the fields exist, instead of checking whether they are truthy.

I updated this in the JavaScript, DOM, and Python evaluators, and in the clone/fallback message path. I also added regression tests for JavaScript and DOM evaluators so this does not regress.

Closes freeCodeCamp/freeCodeCamp#64229

@Sembauke Sembauke requested a review from a team as a code owner March 20, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--fcc-expected-- and --fcc-actual-- handle falsy values incorrecly

1 participant