Realistic testing of your macro extensions is extremely fragile. If you go down this path, any small change in your macro will cause your tests to fail, even if your macro does the same anyway!
The best approach - IMO is to check what your macro should do. We can safely assume that calling your macro has an observed side effect - in your example, it sets the properties in the JS object.
In this case, instead of testing the extension, I would write a test that ensures that the state of the JS object is what you expect from it after calling your macro.
This separates the test from the implementation, giving you the freedom to reorganize your macro as you see fit, as the test is much more reliable and will fail if your macro does the wrong thing.
Generally, I would never test a macro extension.
leonardoborges
source share