test($compile): add test for optional `require` in directives with `^` operator

The directive property `require` allows optional requirement via
the `?` before or after the `^` operator. Add tests to ensure this
functionality is not lost inadvertently.

Closes #9391
It's actually supposed to pass null --- but I see that it doesn't if the controller isn't found and it's optional.

That's a bug, you should fix it in this PR tbh, it will let us write better tests