Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/expect/src/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ function ordinalOf(i: number) {
function formatCalls(spy: MockInstance, msg: string, showActualCall?: any) {
if (spy.mock.calls.length) {
msg += c.gray(
`\n\nReceived: \n\n${spy.mock.calls
`\n\nReceived:\n\n${spy.mock.calls
.map((callArg, i) => {
let methodCall = c.bold(
` ${ordinalOf(i + 1)} ${spy.getMockName()} call:\n\n`,
Expand Down Expand Up @@ -1272,7 +1272,7 @@ function formatReturns(
) {
if (results.length) {
msg += c.gray(
`\n\nReceived: \n\n${results
`\n\nReceived:\n\n${results
.map((callReturn, i) => {
let methodCall = c.bold(
` ${ordinalOf(i + 1)} ${spy.getMockName()} call return:\n\n`,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/components/views/ViewReport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const textStacks = Array.from({ length: 5 }, makeTextStack)
const diff = `
\x1B[32m- Expected\x1B[39m
\x1B[31m+ Received\x1B[39m
\x1B[2m Object {\x1B[22m
\x1B[2m "a": 1,\x1B[22m
\x1B[32m- "b": 2,\x1B[39m
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/diff/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export function diff(a: any, b: any, options?: DiffOptions): string | undefined
}
aDisplay = truncate(aDisplay)
bDisplay = truncate(bDisplay)
const aDiff = `${aColor(`${aIndicator} ${aAnnotation}:`)} \n${aDisplay}`
const bDiff = `${bColor(`${bIndicator} ${bAnnotation}:`)} \n${bDisplay}`
const aDiff = `${aColor(`${aIndicator} ${aAnnotation}:`)}\n${aDisplay}`
const bDiff = `${bColor(`${bIndicator} ${bAnnotation}:`)}\n${bDisplay}`
return `${aDiff}\n\n${bDiff}`
}

Expand Down
8 changes: 4 additions & 4 deletions test/cli/test/stacktraces.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ it('resolves/rejects', async () => {
FAIL repro.test.ts > rejects: resolves when rejection expected
AssertionError: promise resolved "3" instead of rejecting

- Expected:
- Expected:
Error {
"message": "rejected promise",
}

+ Received:
+ Received:
3

❯ repro.test.ts:13:41
Expand Down Expand Up @@ -343,12 +343,12 @@ it('resolves/rejects', async () => {
FAIL repro.test.ts > rejects: resolves when rejection expected
AssertionError: promise resolved "3" instead of rejecting

- Expected:
- Expected:
Error {
"message": "rejected promise",
}

+ Received:
+ Received:
3

❯ repro.test.ts:13:40
Expand Down
72 changes: 36 additions & 36 deletions test/core/test/__snapshots__/jest-expect.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ exports[`asymmetric matcher error 4`] = `
exports[`asymmetric matcher error 5`] = `
{
"actual": "hello",
"diff": "- Expected:
"diff": "- Expected:
stringContainingCustom<"xx">

+ Received:
+ Received:
"hello"",
"expected": "stringContainingCustom<"xx">",
"message": "expected 'hello' to deeply equal stringContainingCustom<"xx">",
Expand All @@ -72,10 +72,10 @@ stringContainingCustom<"xx">
exports[`asymmetric matcher error 6`] = `
{
"actual": "hello",
"diff": "- Expected:
"diff": "- Expected:
not.stringContainingCustom<"ll">

+ Received:
+ Received:
"hello"",
"expected": "not.stringContainingCustom<"ll">",
"message": "expected 'hello' to deeply equal not.stringContainingCustom<"ll">",
Expand Down Expand Up @@ -141,12 +141,12 @@ exports[`asymmetric matcher error 10`] = `
exports[`asymmetric matcher error 11`] = `
{
"actual": "hello",
"diff": "- Expected:
"diff": "- Expected:
testComplexMatcher<Object {
"x": "y",
}>

+ Received:
+ Received:
"hello"",
"expected": "testComplexMatcher<Object {
"x": "y",
Expand Down Expand Up @@ -226,13 +226,13 @@ exports[`asymmetric matcher error 15`] = `
exports[`asymmetric matcher error 16`] = `
{
"actual": "foo",
"diff": "- Expected:
"diff": "- Expected:
toBeOneOf<Array [
"bar",
"baz",
]>

+ Received:
+ Received:
"foo"",
"expected": "toBeOneOf<Array [
"bar",
Expand All @@ -248,14 +248,14 @@ toBeOneOf<Array [
exports[`asymmetric matcher error 17`] = `
{
"actual": "0",
"diff": "- Expected:
"diff": "- Expected:
toBeOneOf<Array [
Any<String>,
null,
undefined,
]>

+ Received:
+ Received:
0",
"expected": "toBeOneOf<Array [
Any<String>,
Expand All @@ -272,7 +272,7 @@ exports[`asymmetric matcher error 18`] = `
"k": "v",
"k2": "v2",
}",
"diff": "- Expected:
"diff": "- Expected:
toBeOneOf<Array [
ObjectContaining {
"k": "v",
Expand All @@ -282,7 +282,7 @@ toBeOneOf<Array [
undefined,
]>

+ Received:
+ Received:
{
"k": "v",
"k2": "v2",
Expand Down Expand Up @@ -320,10 +320,10 @@ exports[`asymmetric matcher error 20`] = `
exports[`asymmetric matcher error 21`] = `
{
"actual": "hello",
"diff": "- Expected:
"diff": "- Expected:
stringContainingCustom<"xx">

+ Received:
+ Received:
"hello"",
"expected": "stringContainingCustom<"xx">",
"message": "expected error to match asymmetric matcher",
Expand All @@ -342,10 +342,10 @@ exports[`asymmetric matcher error 22`] = `
exports[`asymmetric matcher error 23`] = `
{
"actual": "hello",
"diff": "- Expected:
"diff": "- Expected:
stringContainingCustom<"ll">

+ Received:
+ Received:
"hello"",
"expected": "stringContainingCustom<"ll">",
"message": "expected error not to match asymmetric matcher",
Expand All @@ -355,10 +355,10 @@ stringContainingCustom<"ll">
exports[`asymmetric matcher error 24`] = `
{
"actual": "[Error: hello]",
"diff": "- Expected:
"diff": "- Expected:
StringContaining "ll"

+ Received:
+ Received:
Error {
"message": "hello",
}",
Expand All @@ -370,10 +370,10 @@ Error {
exports[`asymmetric matcher error 25`] = `
{
"actual": "[Error: hello]",
"diff": "- Expected:
"diff": "- Expected:
stringContainingCustom<"ll">

+ Received:
+ Received:
Error {
"message": "hello",
}",
Expand All @@ -385,10 +385,10 @@ Error {
exports[`asymmetric matcher error 26`] = `
{
"actual": "[Error: hello]",
"diff": "- Expected:
"diff": "- Expected:
[Function MyError1]

+ Received:
+ Received:
MyError2 {
"message": "hello",
}",
Expand All @@ -400,10 +400,10 @@ MyError2 {
exports[`diff 1`] = `
{
"actual": "undefined",
"diff": "- Expected:
"diff": "- Expected:
true

+ Received:
+ Received:
undefined",
"expected": "true",
"message": "expected undefined to be truthy",
Expand All @@ -415,10 +415,10 @@ exports[`diff 2`] = `
"actual": "Object {
"hello": "world",
}",
"diff": "- Expected:
"diff": "- Expected:
false

+ Received:
+ Received:
{
"hello": "world",
}",
Expand All @@ -432,10 +432,10 @@ exports[`diff 3`] = `
"actual": "Object {
"hello": "world",
}",
"diff": "- Expected:
"diff": "- Expected:
NaN

+ Received:
+ Received:
{
"hello": "world",
}",
Expand All @@ -449,10 +449,10 @@ exports[`diff 4`] = `
"actual": "Object {
"hello": "world",
}",
"diff": "- Expected:
"diff": "- Expected:
undefined

+ Received:
+ Received:
{
"hello": "world",
}",
Expand All @@ -466,10 +466,10 @@ exports[`diff 5`] = `
"actual": "Object {
"hello": "world",
}",
"diff": "- Expected:
"diff": "- Expected:
null

+ Received:
+ Received:
{
"hello": "world",
}",
Expand Down Expand Up @@ -747,7 +747,7 @@ exports[`toBeOneOf() > error message 3`] = `
"actual": "Object {
"a": 0,
}",
"diff": "- Expected:
"diff": "- Expected:
toBeOneOf<Array [
ObjectContaining {
"b": 0,
Expand All @@ -756,7 +756,7 @@ toBeOneOf<Array [
undefined,
]>

+ Received:
+ Received:
{
"a": 0,
}",
Expand Down Expand Up @@ -851,10 +851,10 @@ Received: "hellohellohellohellohellohellohellohellohellohellohellohellohellohell
exports[`toMatch/toContain diff 3`] = `
{
"actual": "hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello",
"diff": "- Expected:
"diff": "- Expected:
/world/

+ Received:
+ Received:
"hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello"",
"expected": "/world/",
"message": "expected 'hellohellohellohellohellohellohellohe…' to match /world/",
Expand Down
6 changes: 3 additions & 3 deletions test/core/test/__snapshots__/mocked.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`mocked function which fails on toReturnWith > just one call 1`] = `
"expected "vi.fn()" to return with: 2 at least once

Received:
Received:

1st vi.fn() call return:

Expand All @@ -18,7 +18,7 @@ Number of calls: 1
exports[`mocked function which fails on toReturnWith > multi calls 1`] = `
"expected "vi.fn()" to return with: 2 at least once

Received:
Received:

1st vi.fn() call return:

Expand All @@ -43,7 +43,7 @@ Number of calls: 3
exports[`mocked function which fails on toReturnWith > oject type 1`] = `
"expected "vi.fn()" to return with: { a: '4' } at least once

Received:
Received:

1st vi.fn() call return:

Expand Down
8 changes: 4 additions & 4 deletions test/core/test/expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ describe('Standard Schema', () => {
const error = processError(err)
const diff = stripVTControlCharacters(error.diff!)
expect(diff).toMatchInlineSnapshot(`
"- Expected:
"- Expected:
SchemaMatching {
"issues": [
{
Expand All @@ -544,7 +544,7 @@ describe('Standard Schema', () => {
],
}

+ Received:
+ Received:
123"
`)
}
Expand Down Expand Up @@ -673,10 +673,10 @@ describe('Standard Schema', () => {
const error = processError(err)
const diff = stripVTControlCharacters(error.diff!)
expect(diff).toMatchInlineSnapshot(`
"- Expected:
"- Expected:
SchemaMatching

+ Received:
+ Received:
"hello""
`)
}
Expand Down
Loading