faker icon indicating copy to clipboard operation
faker copied to clipboard

Add automated tests for fake patterns

Open ST-DDT opened this issue 11 months ago • 1 comments

Clear and concise description of the problem

If we add or change fake patterns (or have to review them), we have to manually check for all possible combinations of patterns.

Suggested solution

Add an automated test that checks fake patterns for errors including errors in nested fake patterns.

Alternative

Keep testing by hand.

Additional context

We have to find a way to detect all fake patterns even if they aren't suffixed with pattern.

Found in: https://github.com/faker-js/faker/pull/3324/commits/bfbd0b608fdcf05966cc1f286d315b9d5f7ac26e

  • https://github.com/faker-js/faker/pull/3324/commits/bfbd0b608fdcf05966cc1f286d315b9d5f7ac26e

ST-DDT avatar Dec 05 '24 13:12 ST-DDT

Sounds useful; though what errors specifically would you test for?

The typo i made could have been caught by checking for a balanced number of } and { characters, but not sure how common that would be.

matthewmayer avatar Dec 05 '24 14:12 matthewmayer