Skip to content

Conversation

@stephenarosaj
Copy link
Contributor

@stephenarosaj stephenarosaj commented Nov 7, 2025

some of the validateAdminArgs() unit tests used a pattern of nested check-expects, and the outer expect would just be checking that a specific error wasn't thrown, which would swallow up any failures from inner expects - it would always pass the outer expect, meaning that even if the inner expects should fail the test, the test would pass.

this is shown on lines 224 of validate-admin-args.spec.ts, where variables are provided to validateAdminArgs() but on line 227 we check that they are undefined. if you bring this incorrect inner expect out of the outer expect, the test fails - because we are expecting undefined when in reality we passed in variables and are correctly returned variables. to be clear, this is an incorrectly written test, but the behavior of the function is correct - the bad test wasn't caught because of this nested check-expects pattern.

changing the testing pattern here to flatten the expects to the same level solves the problem!

@stephenarosaj stephenarosaj added the release:stage Stage a release candidate label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant