pelias / fuzzy-tester

A fuzzy testing library for geocoding
https://pelias.io
4 stars 6 forks source link

Normalize unexpected properties #208

Closed orangejulius closed 2 years ago

orangejulius commented 2 years ago

Without normalizers being applied, many unexpected property checks are likely passing, when they really should fail.

For example, an unexpected property check for 'FOO', would not alert to the existice of 'Foo', even if there was a toLowerCase normalizer set for that property.

I've also included some nice refactoring in this PR. There is logic that can be shared across the now 3 places we do normalization (test expected properties, test unexpected properties, and the actual response properties)