Skip to content

Commit 47cf213

Browse files
authored
Merge pull request #9 from deinsoftware/dev
fix mock snippets and docs
2 parents 3033537 + f699fa1 commit 47cf213

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ Fixed for any bug fixes.
99
Security to invite users to upgrade in case of vulnerabilities.
1010
-->
1111

12+
## 1.4.1 - 2023/04/03
13+
14+
### Fixed
15+
16+
- mock name snippets
17+
- import documentation
18+
1219
## 1.4.0 - 2023/03/31
1320

1421
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Below is a list of all available snippets and the triggers of each one. The `░
7979
| Trigger | Result |
8080
| -------: | ----------------------------------------------------------------- |
8181
| `iv→` | `import { it, expect, describe } from 'vitest'█` |
82-
| `itl→` | `import { render, screen } from '@testing-library/$<react|vue>█` |
82+
| `itl→` | `import { render, screen } from '@testing-library/<react\|vue>█` |
8383
| `itr→` | `import { render, screen } from '@testing-library/react█` |
8484
| `itv→` | `import { render, screen } from '@testing-library/vue█` |
8585

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vitest-snippets",
33
"description": "VS Code Vitest snippets for JS and TS",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"displayName": "Vitest Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",

snippets/mock.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@
1111
},
1212
"const.fn": {
1313
"prefix": "cf",
14-
"body": "const {$1:name}Mock = vi.fn()$0",
14+
"body": "const ${1:name}Mock = vi.fn()$0",
1515
"description": "creates a mock variable for a vi.fn()"
1616
},
1717
"const.fn.mockResolvedValue": {
1818
"prefix": "cfrv",
19-
"body": "const {$1:name}Mock = vi.fn().mockResolvedValue($0)",
19+
"body": "const ${1:name}Mock = vi.fn().mockResolvedValue($0)",
2020
"description": "creates a mock variable for a vi.fn() with resolved value"
2121
},
2222
"mock.mockReturnValue": {
2323
"prefix": "mrv",
24-
"body": "{$1:mock}.mockReturnValue($0)",
24+
"body": "${1:mock}.mockReturnValue($0)",
2525
"description": "assign a return value"
2626
},
2727
"mock.mockReturnValueOnce": {
2828
"prefix": "mrvo",
29-
"body": "{$1:mock}.mockReturnValueOnce($0)",
29+
"body": "${1:mock}.mockReturnValueOnce($0)",
3030
"description": "assign a return value for only one call"
3131
},
3232
"vi.spyOn": {
3333
"prefix": "vs",
34-
"body": "vi.spyOn({$1:global}, '{$2:method}'))$0",
34+
"body": "vi.spyOn(${1:global}, '${2:method}'))$0",
3535
"description": "creates vi.spyOn()"
3636
},
3737
"vi.spyOn.mockImplementation": {
3838
"prefix": "vsi",
39-
"body": "vi.spyOn({$1:global}, '{$2:method}')).mockImplementation(() => $0)",
39+
"body": "vi.spyOn(${1:global}, '${2:method}')).mockImplementation(() => $0)",
4040
"description": "creates vi.spyOn() with mock implementation"
4141
},
4242
"const.spyOn": {
4343
"prefix": "cs",
44-
"body": "const {$2:method}Spy = vi.spyOn({$1:global}, '{$2:method}'))$0",
44+
"body": "const ${2:method}Spy = vi.spyOn(${1:global}, '${2:method}'))$0",
4545
"description": "creates a spy variable for a vi.spyOn()"
4646
},
4747
"const.spyOn.mockImplementation": {
4848
"prefix": "csi",
49-
"body": "const {$2:method}Spy = vi.spyOn({$1:global}, '{$2:method}')).mockImplementation(() => $0)",
49+
"body": "const ${2:method}Spy = vi.spyOn(${1:global}, '${2:method}')).mockImplementation(() => $0)",
5050
"description": "creates a spy variable for a vi.spyOn() with mock implementation"
5151
}
5252
}

0 commit comments

Comments
 (0)