Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display error message correctly #3314

Merged
merged 5 commits into from May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions test/core/test/__snapshots__/mocked.test.ts.snap
Expand Up @@ -6,8 +6,8 @@ exports[`mocked function which fails on toReturnWith > just one call 1`] = `
Received:
1st spy call return:

- 2
+ 1
- 1
+ 2


Number of calls: 1
Expand All @@ -20,18 +20,18 @@ exports[`mocked function which fails on toReturnWith > multi calls 1`] = `
Received:
1st spy call return:

- 2
+ 1
- 1
+ 2

2nd spy call return:

- 2
+ 1
- 1
+ 2

3rd spy call return:

- 2
+ 1
- 1
+ 2


Number of calls: 3
Expand All @@ -45,22 +45,22 @@ Received:
1st spy call return:

{
- a: '4',
+ a: '1',
- a: '1',
sheremet-va marked this conversation as resolved.
Show resolved Hide resolved
+ a: '4',
}

2nd spy call return:

{
- a: '4',
+ a: '1',
- a: '1',
+ a: '4',
}

3rd spy call return:

{
- a: '4',
+ a: '1',
- a: '1',
+ a: '4',
}


Expand Down
19 changes: 9 additions & 10 deletions test/core/test/diff.test.ts
Expand Up @@ -15,8 +15,8 @@ test('displays object diff', () => {

{
a: 1,
- b: 3,
+ b: 2,
- b: 2,
+ b: 3,
}"
`)
})
Expand All @@ -31,8 +31,8 @@ test('display one line string diff', () => {
" - Expected - 1
+ Received + 1

- 'string2'
+ 'string1'"
- 'string1'
+ 'string2'"
`)
})

Expand All @@ -43,13 +43,12 @@ test('display multiline line string diff', () => {
setupColors(getDefaultColors())
displayDiff(unifiedDiff(string1, string2), console as any)
expect(console.error.mock.calls[0][0]).toMatchInlineSnapshot(`
" - Expected - 2
" - Expected - 1
+ Received + 2

+ string1
\`string2
- string2
- string1\`
+ string3\`"
- \`string1
string2
- string3\`
+ \`string2"
`)
})