postcode icon indicating copy to clipboard operation
postcode copied to clipboard

Testing with global formatter

Open rubentebogt opened this issue 1 year ago • 0 comments

Hi Ben, as discussed in the previous PR 13, i hereby present a new PR to make testing use the global postcode formatter.

A few things to note:

  1. Because this is a proof of concept commit, for readability i only changed the BE formatter test. Others will follow later of course if necessary.
  2. This PR makes al the getFormatter functions in the tests and abstract test class obsolete but they have not yet been removed.
  3. This PR introduces the new getCountry function in the abstract test class using reflection because according to my research this is the easiest and fastest way. However i know that your not a fan of this which is why i am open to suggestions. It was also a fast way of showing you in this PR what i am trying to accomplish. Reflection does however reassure that the formatter has to bo named exactly in the same way as the test and if not, it will all fail.
  4. I again want to stretch that this ensures that the test actually tests the actual output and format a user will see when using the public API of this package. Especially when a stripe or space is part of the format and future changes may interfere.

@BenMorel Looking forward to your viewings on this.

rubentebogt avatar Oct 09 '24 11:10 rubentebogt