When I have an @onready that references a missing node, the variable gets set to null. In every case, what I’d prefer is an assert. Other than writing out all the asserts by hand, which is redundant, is there any way to make @onready actually assert if the value can’t be set?
I can submit this as an enhancement if it makes sense; I’m just wondering if there are cases where you would want the @onready var set to null.
I believe users who want an automatic assertion system would consider making use of the GDUnit4 addon, although it’s heavily dependent on how the game systems are constructed (if an @onready being null is an edge case or the norm).
I assume some people take it further and write a global method that iterates over any given object’s properties and assert them.