Add a first pass at jsdoc.

[##130415655] #596
This commit is contained in:
Gregg Van Hove
2017-03-21 11:36:41 -07:00
parent a37b6c0d32
commit 9cb2f06aa6
30 changed files with 553 additions and 9 deletions

View File

@@ -2,6 +2,19 @@ getJasmineRequireObj().toThrowError = function(j$) {
var getErrorMsg = j$.formatErrorMsg('<toThrowError>', 'expect(function() {<expectation>}).toThrowError(<ErrorConstructor>, <message>)');
/**
* {@link expect} a function to `throw` an `Error`.
* @function
* @name matchers#toThrowError
* @param {Error} [expected] - `Error` constructor the object that was thrown needs to be an instance of. If not provided, `Error` will be used.
* @param {RegExp|String} [message] - The message that should be set on the thrown `Error`
* @example
* expect(function() { return 'things'; }).toThrowError(MyCustomError, 'message');
* expect(function() { return 'things'; }).toThrowError(MyCustomError, /bar/);
* expect(function() { return 'stuff'; }).toThrowError(MyCustomError);
* expect(function() { return 'other'; }).toThrowError(/foo/);
* expect(function() { return 'other'; }).toThrowError();
*/
function toThrowError () {
return {
compare: function(actual) {