Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/matchers/toBeAfter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeAfter(date, after) {
const { printReceived, matcherHint } = this.utils;
const { printExpected, printReceived, matcherHint } = this.utils;

const pass = date > after;

Expand All @@ -9,11 +9,11 @@ export function toBeAfter(date, after) {
pass
? matcherHint('.not.toBeAfter', 'received', '') +
'\n\n' +
`Expected date to be after ${printReceived(after)} but received:\n` +
`Expected date to be after ${printExpected(after)} but received:\n` +
` ${printReceived(date)}`
: matcherHint('.toBeAfter', 'received', '') +
'\n\n' +
`Expected date to be after ${printReceived(after)} but received:\n` +
`Expected date to be after ${printExpected(after)} but received:\n` +
` ${printReceived(date)}`,
};
}
6 changes: 3 additions & 3 deletions src/matchers/toBeAfterOrEqualTo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeAfterOrEqualTo(actual, expected) {
const { printReceived, matcherHint } = this.utils;
const { printExpected, printReceived, matcherHint } = this.utils;

const pass = actual >= expected;

Expand All @@ -9,11 +9,11 @@ export function toBeAfterOrEqualTo(actual, expected) {
pass
? matcherHint('.not.toBeAfterOrEqualTo', 'received', '') +
'\n\n' +
`Expected date to be after or equal to ${printReceived(expected)} but received:\n` +
`Expected date to be after or equal to ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`
: matcherHint('.toBeAfterOrEqualTo', 'received', '') +
'\n\n' +
`Expected date to be after or equal to ${printReceived(expected)} but received:\n` +
`Expected date to be after or equal to ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`,
};
}
6 changes: 3 additions & 3 deletions src/matchers/toBeArray.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeArray(expected) {
const { matcherHint, printReceived } = this.utils;
const { printExpected, matcherHint, printReceived } = this.utils;

const pass = Array.isArray(expected);

Expand All @@ -10,10 +10,10 @@ export function toBeArray(expected) {
? matcherHint('.not.toBeArray', 'received', '') +
'\n\n' +
'Expected value to not be an array received:\n' +
` ${printReceived(expected)}`
` ${printExpected(expected)}`
: matcherHint('.toBeArray', 'received', '') +
'\n\n' +
'Expected value to be an array received:\n' +
` ${printReceived(expected)}`,
` ${printExpected(expected)}`,
};
}
6 changes: 3 additions & 3 deletions src/matchers/toBeBefore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeBefore(actual, expected) {
const { matcherHint, printReceived } = this.utils;
const { printExpected, matcherHint, printReceived } = this.utils;

const pass = actual < expected;

Expand All @@ -9,11 +9,11 @@ export function toBeBefore(actual, expected) {
pass
? matcherHint('.not.toBeBefore', 'received', '') +
'\n\n' +
`Expected date to be before ${printReceived(expected)} but received:\n` +
`Expected date to be before ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`
: matcherHint('.toBeBefore', 'received', '') +
'\n\n' +
`Expected date to be before ${printReceived(expected)} but received:\n` +
`Expected date to be before ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`,
};
}
6 changes: 3 additions & 3 deletions src/matchers/toBeBeforeOrEqualTo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeBeforeOrEqualTo(actual, expected) {
const { matcherHint, printReceived } = this.utils;
const { matcherHint, printExpected, printReceived } = this.utils;

const pass = actual <= expected;

Expand All @@ -9,11 +9,11 @@ export function toBeBeforeOrEqualTo(actual, expected) {
pass
? matcherHint('.not.toBeBeforeOrEqualTo', 'received', '') +
'\n\n' +
`Expected date to be before or equal to ${printReceived(expected)} but received:\n` +
`Expected date to be before or equal to ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`
: matcherHint('.toBeBeforeOrEqualTo', 'received', '') +
'\n\n' +
`Expected date to be before or equal to ${printReceived(expected)} but received:\n` +
`Expected date to be before or equal to ${printExpected(expected)} but received:\n` +
` ${printReceived(actual)}`,
};
}
6 changes: 3 additions & 3 deletions src/matchers/toBeBetween.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function toBeBetween(actual, startDate, endDate) {
const { matcherHint, printReceived } = this.utils;
const { matcherHint, printExpected, printReceived } = this.utils;

const pass = actual >= startDate && actual <= endDate;

Expand All @@ -9,11 +9,11 @@ export function toBeBetween(actual, startDate, endDate) {
pass
? matcherHint('.not.toBeBetween', 'received', '') +
'\n\n' +
`Expected date to be between ${printReceived(startDate)} and ${printReceived(endDate)} but received:\n` +
`Expected date to be between ${printExpected(startDate)} and ${printExpected(endDate)} but received:\n` +
` ${printReceived(actual)}`
: matcherHint('.toBeBetween', 'received', '') +
'\n\n' +
`Expected date to be between ${printReceived(startDate)} and ${printReceived(endDate)} but received:\n` +
`Expected date to be between ${printExpected(startDate)} and ${printExpected(endDate)} but received:\n` +
` ${printReceived(actual)}`,
};
}
2 changes: 1 addition & 1 deletion src/matchers/toBeExtensible.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function toBeExtensible(actual) {
? matcherHint('.not.toBeExtensible', 'received', '') +
'\n\n' +
'Expected value to not be extensible received:\n' +
` ${printExpected(actual)}\n`
` ${printReceived(actual)}\n`
: matcherHint('.toBeExtensible', 'received', '') +
'\n\n' +
'Expected value to be extensible received:\n' +
Expand Down
4 changes: 3 additions & 1 deletion src/matchers/toBeString.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export function toBeString(expected) {
? matcherHint('.not.toBeString', 'received', '') +
'\n\n' +
'Expected value to not be of type string received:\n' +
` ${printReceived(expected)}`
` ${printExpected(expected)}\n` +
'Received:\n' +
` ${printReceived(typeof expected)}`
: matcherHint('.toBeString', 'received', '') +
'\n\n' +
'Expected value to be of type string:\n' +
Expand Down