The documentation at https://github.com/pivotal/jasmine/wiki/Matchers includes the following:
expect(function(){fn();}).toThrow(e);
As disc
Sadly, it seems that if I need to test a function that takes parameters, then I will need to wrap it with a function.
I would rather have preferred,
expect(myTestFunction, arg1, arg2).toThrow();
But I am ok with explicitly doing
expect(function(){myTestFunction(arg1, arg2);}).toThrow("some error");
FYI note that we can also use regex match on error:
expect(function (){myTestFunction(arg1, arg2);}).toThrowError(/err/);