Up until now, our
Calcsclass has handled errors with simpletrueandfalseflags. That’s not helpful to the user. At this point, we’re ready to begin defining and testing custom errors in our functions.
QUnit allows a throws method which can check for errors in your application. This tutorial post adds some error checking to a simple Apps Script project.
Source: Unit Testing in GAS Part 4: Error Handling | ohhey[blog]
