How do you think you would want it to handle non-code breaking UI that is actually broken from the users point of view?
Maybe an account toggle or group of settings so that if your code can’t compile, and / or doesn’t pass your test suite, then the publish button will not work in the IDE? (Or just reject publishing with an error?)
Just some thoughts.
Edit:
In a similar idea, has anyone using TDD used or tried to use github-actions and/or tox (or something similar) connected to their anvil-repo for any of the anvil projects they work on? I would guess it would be possible to even have github email you if your code fails tests after it gets auto-updated by the anvil IDE. (I wonder if you would get spammed by these messages just by working on your app )