Last active
August 16, 2021 19:09
-
-
Save mvcds/d640794e43df3e18d1618eeeb06ebe76 to your computer and use it in GitHub Desktop.
Testing data or rules 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function canBuyProduct({ age }: User, { kind }: Product): boolean { | |
const result = age >= this.ageRestriction[kind] | |
// when debugging, we can create and/or tweak data | |
// this way we force the code to flow in the directions that interests the task at hand | |
// remember to revert your changes =D | |
if (true) { | |
logger.warn('front-end exposed user to invalid product') | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment