Replaced uses of var with const/let
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
getJasmineRequireObj().toThrowMatching = function(j$) {
|
||||
var usageError = j$.formatErrorMsg(
|
||||
const usageError = j$.formatErrorMsg(
|
||||
'<toThrowMatching>',
|
||||
'expect(function() {<expectation>}).toThrowMatching(<Predicate>)'
|
||||
);
|
||||
@@ -16,8 +16,6 @@ getJasmineRequireObj().toThrowMatching = function(j$) {
|
||||
function toThrowMatching(matchersUtil) {
|
||||
return {
|
||||
compare: function(actual, predicate) {
|
||||
var thrown;
|
||||
|
||||
if (typeof actual !== 'function') {
|
||||
throw new Error(usageError('Actual is not a Function'));
|
||||
}
|
||||
@@ -26,6 +24,8 @@ getJasmineRequireObj().toThrowMatching = function(j$) {
|
||||
throw new Error(usageError('Predicate is not a Function'));
|
||||
}
|
||||
|
||||
let thrown;
|
||||
|
||||
try {
|
||||
actual();
|
||||
return fail('Expected function to throw an exception.');
|
||||
|
||||
Reference in New Issue
Block a user