jest-matcher-utils
Advanced tools
Comparing version 28.0.0-alpha.5 to 28.0.0-alpha.6
@@ -367,3 +367,3 @@ 'use strict'; | ||
); | ||
return expectedLine + '\n' + receivedLine; | ||
return `${expectedLine}\n${receivedLine}`; | ||
} | ||
@@ -388,4 +388,4 @@ | ||
typeof difference === 'string' && | ||
difference.includes('- ' + expectedLabel) && | ||
difference.includes('+ ' + receivedLabel) | ||
difference.includes(`- ${expectedLabel}`) && | ||
difference.includes(`+ ${receivedLabel}`) | ||
) { | ||
@@ -403,3 +403,3 @@ return difference; | ||
: printReceived(received)); | ||
return expectedLine + '\n' + receivedLine; | ||
return `${expectedLine}\n${receivedLine}`; | ||
}; // Sometimes, e.g. when comparing two numbers, the output from jest-diff | ||
@@ -495,3 +495,3 @@ // does not contain more information than the `Expected:` / `Received:` already gives. | ||
const pluralize = (word, count) => | ||
(NUMBERS[count] || count) + ' ' + word + (count === 1 ? '' : 's'); // To display lines of labeled values as two columns with monospace alignment: | ||
`${NUMBERS[count] || count} ${word}${count === 1 ? '' : 's'}`; // To display lines of labeled values as two columns with monospace alignment: | ||
// given the strings which will describe the values, | ||
@@ -519,3 +519,3 @@ // return function which given each string, returns the label: | ||
`${hint}\n\n${_chalk.default.bold('Matcher error')}: ${generic}${ | ||
typeof specific === 'string' ? '\n\n' + specific : '' | ||
typeof specific === 'string' ? `\n\n${specific}` : '' | ||
}`; // Display assertion for the report when a test fails. | ||
@@ -548,3 +548,3 @@ // New format: rejects/resolves, not, and matcher name have black color | ||
if (!isDirectExpectCall && received !== '') { | ||
hint += DIM_COLOR(dimString + '(') + receivedColor(received); | ||
hint += DIM_COLOR(`${dimString}(`) + receivedColor(received); | ||
dimString = ')'; | ||
@@ -554,3 +554,3 @@ } | ||
if (promise !== '') { | ||
hint += DIM_COLOR(dimString + '.') + promise; | ||
hint += DIM_COLOR(`${dimString}.`) + promise; | ||
dimString = ''; | ||
@@ -560,3 +560,3 @@ } | ||
if (isNot) { | ||
hint += DIM_COLOR(dimString + '.') + 'not'; | ||
hint += `${DIM_COLOR(`${dimString}.`)}not`; | ||
dimString = ''; | ||
@@ -571,3 +571,3 @@ } | ||
// New format: omit period from matcherName arg | ||
hint += DIM_COLOR(dimString + '.') + matcherName; | ||
hint += DIM_COLOR(`${dimString}.`) + matcherName; | ||
dimString = ''; | ||
@@ -579,3 +579,3 @@ } | ||
} else { | ||
hint += DIM_COLOR(dimString + '(') + expectedColor(expected); | ||
hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected); | ||
@@ -590,3 +590,3 @@ if (secondArgument) { | ||
if (comment !== '') { | ||
dimString += ' // ' + comment; | ||
dimString += ` // ${comment}`; | ||
} | ||
@@ -593,0 +593,0 @@ |
{ | ||
"name": "jest-matcher-utils", | ||
"description": "A set of utility functions for expect and related packages", | ||
"version": "28.0.0-alpha.5", | ||
"version": "28.0.0-alpha.6", | ||
"repository": { | ||
@@ -25,8 +25,8 @@ "type": "git", | ||
"chalk": "^4.0.0", | ||
"jest-diff": "^28.0.0-alpha.5", | ||
"jest-diff": "^28.0.0-alpha.6", | ||
"jest-get-type": "^28.0.0-alpha.3", | ||
"pretty-format": "^28.0.0-alpha.5" | ||
"pretty-format": "^28.0.0-alpha.6" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^28.0.0-alpha.5", | ||
"@jest/test-utils": "^28.0.0-alpha.6", | ||
"@types/node": "*" | ||
@@ -37,3 +37,3 @@ }, | ||
}, | ||
"gitHead": "46fb19b2628bd87676c10730ba19592c30b05478" | ||
"gitHead": "6284ada4adb7008f5f8673b1a7b1c789d2e508fb" | ||
} |
27881
Updatedjest-diff@^28.0.0-alpha.6