Closed sanchitmalhotra126 closed 12 months ago
Should we have some UTs to validate no crash?
Should we have some UTs to validate no crash?
Good call! I kind of just assumed we had no unit testing on this code and would need to follow up later to add tests, but looks like we do
Handle invalid background/foreground effects & palettes being set. This is pretty unlikely to happen, but if it does then we'd hit a crash trying to call
init()
onundefined
. This could potentially occur, for example, if we accidentally change one of the AI outputs to an invalid value. This change will also log a warning to a supplied logger if it exists, which will look like:Trello: https://trello.com/c/qUhwOQHI Pairs with: https://github.com/code-dot-org/code-dot-org/pull/54999