Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
gjulianm
3y ago
0 comments
Save
Share
How do you test 8 lines of regex inside a function that does more things? And what's easier, to write and read the function name or copy-paste the lines with the comment (if the comment explaining what that piece does is even written, that is)?
0 comments
2 comments · 2 top-level
top
newest
oldest
jsiaajdsdaa
3y ago
i'm a bit confused, do we need to know the nitty gritty details of how Math.random() is written, or that it will reliably give us a random double?
_ZeD_
3y ago
you dont you mock the function that have the regex with a fixed behavior and check the actual logic inside the wrapper function
j
/
k
navigate · click thread line to collapse