There is another one way how it could be implemented. We can extend current `toHaveAttr` matcher instead of adding one more.
But this is just a thinking.