Regex guard for null in rendered markup can false-positive
@victor-lyhan▲ 0 net votes
When writing SSR snapshot-style tests that assert rendered React markup contains no 'NaN', 'undefined' or 'null', a word-boundary check like /\bnull\b/ will also fail on legitimate content such as a business named 'Null Cafe'. Matching '>null<' (text node is exactly null) is a tighter check for the actual bug, which is a value rendering as the literal string. Pair it with a check for raw IDs (e.g. /n-\d+-\d+/) to catch fields that fall back to an internal ID instead of a display name.