-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update colors implementation (#2975)
- Loading branch information
1 parent
0699182
commit 18d8019
Showing
3 changed files
with
93 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,79 @@ | ||
// 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[90m | ||
"expected \\"spy\\" to return with: 2 at least once | ||
Received: | ||
[1m 1st spy call return: | ||
1st spy call return: | ||
[22m [32m1[90m | ||
[31m2[90m | ||
[39m[90m | ||
1 | ||
2 | ||
Number of calls: [1m1[22m | ||
[39m" | ||
Number of calls: 1 | ||
" | ||
`; | ||
|
||
exports[`mocked function which fails on toReturnWith > multi calls 1`] = ` | ||
"expected \\"spy\\" to return with: 2 at least once[90m | ||
"expected \\"spy\\" to return with: 2 at least once | ||
Received: | ||
[1m 1st spy call return: | ||
1st spy call return: | ||
1 | ||
2 | ||
[22m [32m1[90m | ||
[31m2[90m | ||
2nd spy call return: | ||
[1m 2nd spy call return: | ||
1 | ||
2 | ||
[22m [32m1[90m | ||
[31m2[90m | ||
3rd spy call return: | ||
[1m 3rd spy call return: | ||
1 | ||
2 | ||
[22m [32m1[90m | ||
[31m2[90m | ||
[39m[90m | ||
Number of calls: [1m3[22m | ||
[39m" | ||
Number of calls: 3 | ||
" | ||
`; | ||
|
||
exports[`mocked function which fails on toReturnWith > oject type 1`] = ` | ||
"expected \\"spy\\" to return with: { a: '4' } at least once[90m | ||
"expected \\"spy\\" to return with: { a: '4' } at least once | ||
Received: | ||
[1m 1st spy call return: | ||
1st spy call return: | ||
[22m Object { | ||
[32m- \\"a\\": \\"1\\",[90m | ||
[31m+ \\"a\\": \\"4\\",[90m | ||
Object { | ||
- \\"a\\": \\"1\\", | ||
+ \\"a\\": \\"4\\", | ||
} | ||
[1m 2nd spy call return: | ||
2nd spy call return: | ||
[22m Object { | ||
[32m- \\"a\\": \\"1\\",[90m | ||
[31m+ \\"a\\": \\"4\\",[90m | ||
Object { | ||
- \\"a\\": \\"1\\", | ||
+ \\"a\\": \\"4\\", | ||
} | ||
[1m 3rd spy call return: | ||
3rd spy call return: | ||
[22m Object { | ||
[32m- \\"a\\": \\"1\\",[90m | ||
[31m+ \\"a\\": \\"4\\",[90m | ||
Object { | ||
- \\"a\\": \\"1\\", | ||
+ \\"a\\": \\"4\\", | ||
} | ||
[39m[90m | ||
Number of calls: [1m3[22m | ||
[39m" | ||
Number of calls: 3 | ||
" | ||
`; | ||
|
||
exports[`mocked function which fails on toReturnWith > zero call 1`] = ` | ||
"expected \\"spy\\" to return with: 2 at least once[90m | ||
"expected \\"spy\\" to return with: 2 at least once | ||
Received: | ||
[39m[90m | ||
Number of calls: [1m0[22m | ||
[39m" | ||
Number of calls: 0 | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { getDefaultColors, setupColors } from '@vitest/utils' | ||
import { beforeEach, vi } from 'vitest' | ||
|
||
vi.mock('../src/global-mock', () => ({ mocked: true })) | ||
|
||
beforeEach(() => { | ||
// console.log(`hi ${s.name}`) | ||
setupColors(getDefaultColors()) | ||
}) |