Replaced var with const and let in ExpectationResult

This commit is contained in:
Steve Gravrock
2022-06-01 09:02:43 -07:00
parent bbb1b69b2e
commit 8f16021887

View File

@@ -1,8 +1,8 @@
//TODO: expectation result may make more sense as a presentation of an expectation. //TODO: expectation result may make more sense as a presentation of an expectation.
getJasmineRequireObj().buildExpectationResult = function(j$) { getJasmineRequireObj().buildExpectationResult = function(j$) {
function buildExpectationResult(options) { function buildExpectationResult(options) {
var messageFormatter = options.messageFormatter || function() {}, const messageFormatter = options.messageFormatter || function() {};
stackFormatter = options.stackFormatter || function() {}; const stackFormatter = options.stackFormatter || function() {};
/** /**
* @typedef Expectation * @typedef Expectation
@@ -16,7 +16,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
* is reported on the top suite. Valid values are undefined, "afterAll", * is reported on the top suite. Valid values are undefined, "afterAll",
* "load", "lateExpectation", and "lateError". * "load", "lateExpectation", and "lateError".
*/ */
var result = { const result = {
matcherName: options.matcherName, matcherName: options.matcherName,
message: message(), message: message(),
stack: options.omitStackTrace ? '' : stack(), stack: options.omitStackTrace ? '' : stack(),
@@ -62,7 +62,8 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
return ''; return '';
} }
var error = options.error; let error = options.error;
if (!error) { if (!error) {
if (options.errorForStack) { if (options.errorForStack) {
error = options.errorForStack; error = options.errorForStack;