Skip to content

Commit

Permalink
Fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
csouchet committed Oct 14, 2020
1 parent e6d79c2 commit b25f60f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/e2e/matchers/toBeCell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export function buildCellMatcher<R>(

const cell = getCell(received);
if (!cell) {
const messageEnd = !matcherContext.isNot
? `${EXPECTED_LABEL}: ${cellKind} with id '${received}' not to be found`
: utils.printDiffOrStringify(expectedCell, undefined, `${EXPECTED_LABEL}: ${cellKind} with id '${expectedCell.id}'`, `${RECEIVED_LABEL}`, expand);
return { message: () => utils.matcherHint(matcherName, undefined, undefined, options) + '\n\n' + messageEnd, pass: false };
const message = (): string =>
utils.matcherHint(matcherName, undefined, undefined, options) +
'\n\n' +
utils.printDiffOrStringify(expectedCell, undefined, `${EXPECTED_LABEL}: ${cellKind} with id '${expectedCell.id}'`, `${RECEIVED_LABEL}`, expand);
return { message, pass: false };
}

const receivedCell: ExpectedCell = buildReceivedCell(cell);
Expand Down

0 comments on commit b25f60f

Please sign in to comment.