Skip to content

Commit

Permalink
test: update remaining tests affected by change
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Miller committed Apr 26, 2023
1 parent 7a18ee1 commit 119fa07
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions test/core/test/__snapshots__/mocked.test.ts.snap
@@ -1,10 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`mocked function which fails on toReturnWith > just one call 1`] = `
"expected \\"spy\\" to return with: 2 at least once
"expected \\"fn\\" to return with: 2 at least once
Received:
1st spy call return:
1st fn call return:
- 1
+ 2
Expand All @@ -15,20 +15,20 @@ Number of calls: 1
`;

exports[`mocked function which fails on toReturnWith > multi calls 1`] = `
"expected \\"spy\\" to return with: 2 at least once
"expected \\"fn\\" to return with: 2 at least once
Received:
1st spy call return:
1st fn call return:
- 1
+ 2
2nd spy call return:
2nd fn call return:
- 1
+ 2
3rd spy call return:
3rd fn call return:
- 1
+ 2
Expand All @@ -39,24 +39,24 @@ Number of calls: 3
`;

exports[`mocked function which fails on toReturnWith > oject type 1`] = `
"expected \\"spy\\" to return with: { a: '4' } at least once
"expected \\"fn\\" to return with: { a: '4' } at least once
Received:
1st spy call return:
1st fn call return:
{
- a: '1',
+ a: '4',
}
2nd spy call return:
2nd fn call return:
{
- a: '1',
+ a: '4',
}
3rd spy call return:
3rd fn call return:
{
- a: '1',
Expand All @@ -69,7 +69,7 @@ Number of calls: 3
`;

exports[`mocked function which fails on toReturnWith > zero call 1`] = `
"expected \\"spy\\" to return with: 2 at least once
"expected \\"fn\\" to return with: 2 at least once
Received:
Expand Down
4 changes: 2 additions & 2 deletions test/core/test/__snapshots__/snapshot.test.ts.snap
Expand Up @@ -26,10 +26,10 @@ exports[`properties snapshot 1`] = `
}
`;
exports[`renders mock snapshot 1`] = `[MockFunction spy]`;
exports[`renders mock snapshot 1`] = `[MockFunction fn]`;
exports[`renders mock snapshot 2`] = `
[MockFunction spy] {
[MockFunction fn] {
"calls": [
[
"hello",
Expand Down
4 changes: 2 additions & 2 deletions test/core/test/jest-expect.test.ts
Expand Up @@ -523,7 +523,7 @@ describe('toHaveBeenCalled', () => {

expect(() => {
expect(mock).not.toHaveBeenCalled()
}).toThrow(/^expected "spy" to not be called at all[^e]/)
}).toThrow(/^expected "fn" to not be called at all[^e]/)
})
})
})
Expand All @@ -536,7 +536,7 @@ describe('toHaveBeenCalledWith', () => {

expect(() => {
expect(mock).not.toHaveBeenCalledWith(3)
}).toThrow(/^expected "spy" to not be called with arguments: \[ 3 \][^e]/)
}).toThrow(/^expected "fn" to not be called with arguments: \[ 3 \][^e]/)
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/core/test/snapshot.test.ts
Expand Up @@ -92,10 +92,10 @@ test('renders mock snapshot', () => {

test('renders inline mock snapshot', () => {
const fn = vi.fn()
expect(fn).toMatchInlineSnapshot('[MockFunction spy]')
expect(fn).toMatchInlineSnapshot('[MockFunction fn]')
fn('hello', 'world', 2)
expect(fn).toMatchInlineSnapshot(`
[MockFunction spy] {
[MockFunction fn] {
"calls": [
[
"hello",
Expand Down

0 comments on commit 119fa07

Please sign in to comment.