MCPcopy Create free account
hub / github.com/GNOME/gjs / assertRaises

Function assertRaises

modules/script/jsUnit.js:163–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161
162// GJS: assertRaises(function)
163function assertRaises() {
164 _validateArguments(1, arguments);
165 var fun=nonCommentArg(1, 1, arguments);
166 var exception;
167
168 if (typeof(fun) != 'function')
169 error("Bad argument to assertRaises(function)");
170
171 var retval;
172 try {
173 retval = fun();
174 } catch (e) {
175 exception = e;
176 }
177
178 _assert(commentArg(1, arguments), exception !== top.JSUNIT_UNDEFINED_VALUE, "Call to assertRaises(function) did not raise an exception. Return value was " + _displayStringForValue(retval) + ' (' + typeof(retval) + ')');
179}
180
181function isLoaded() {
182 return isTestPageLoaded;

Callers

nothing calls this directly

Calls 6

_validateArgumentsFunction · 0.85
nonCommentArgFunction · 0.85
errorFunction · 0.85
_assertFunction · 0.85
commentArgFunction · 0.85
_displayStringForValueFunction · 0.85

Tested by

no test coverage detected