diff --git a/CHANGELOG.md b/CHANGELOG.md index 96cf041..fc7b2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ Fixed for any bug fixes. Security to invite users to upgrade in case of vulnerabilities. --> +## 1.4.1 - 2023/04/03 + +### Fixed + +- mock name snippets +- import documentation + ## 1.4.0 - 2023/03/31 ### Added diff --git a/README.md b/README.md index d533f0b..4c7a75d 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Below is a list of all available snippets and the triggers of each one. The `░ | Trigger | Result | | -------: | ----------------------------------------------------------------- | | `iv→` | `import { it, expect, describe } from 'vitest'█` | -| `itl→` | `import { render, screen } from '@testing-library/$█` | +| `itl→` | `import { render, screen } from '@testing-library/░█` | | `itr→` | `import { render, screen } from '@testing-library/react█` | | `itv→` | `import { render, screen } from '@testing-library/vue█` | diff --git a/package.json b/package.json index 1496a40..c289a6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vitest-snippets", "description": "VS Code Vitest snippets for JS and TS", - "version": "1.4.0", + "version": "1.4.1", "displayName": "Vitest Snippets", "publisher": "deinsoftware", "icon": "images/light-icon.png", diff --git a/snippets/mock.json b/snippets/mock.json index 12e8f11..feaff42 100644 --- a/snippets/mock.json +++ b/snippets/mock.json @@ -11,42 +11,42 @@ }, "const.fn": { "prefix": "cf", - "body": "const {$1:name}Mock = vi.fn()$0", + "body": "const ${1:name}Mock = vi.fn()$0", "description": "creates a mock variable for a vi.fn()" }, "const.fn.mockResolvedValue": { "prefix": "cfrv", - "body": "const {$1:name}Mock = vi.fn().mockResolvedValue($0)", + "body": "const ${1:name}Mock = vi.fn().mockResolvedValue($0)", "description": "creates a mock variable for a vi.fn() with resolved value" }, "mock.mockReturnValue": { "prefix": "mrv", - "body": "{$1:mock}.mockReturnValue($0)", + "body": "${1:mock}.mockReturnValue($0)", "description": "assign a return value" }, "mock.mockReturnValueOnce": { "prefix": "mrvo", - "body": "{$1:mock}.mockReturnValueOnce($0)", + "body": "${1:mock}.mockReturnValueOnce($0)", "description": "assign a return value for only one call" }, "vi.spyOn": { "prefix": "vs", - "body": "vi.spyOn({$1:global}, '{$2:method}'))$0", + "body": "vi.spyOn(${1:global}, '${2:method}'))$0", "description": "creates vi.spyOn()" }, "vi.spyOn.mockImplementation": { "prefix": "vsi", - "body": "vi.spyOn({$1:global}, '{$2:method}')).mockImplementation(() => $0)", + "body": "vi.spyOn(${1:global}, '${2:method}')).mockImplementation(() => $0)", "description": "creates vi.spyOn() with mock implementation" }, "const.spyOn": { "prefix": "cs", - "body": "const {$2:method}Spy = vi.spyOn({$1:global}, '{$2:method}'))$0", + "body": "const ${2:method}Spy = vi.spyOn(${1:global}, '${2:method}'))$0", "description": "creates a spy variable for a vi.spyOn()" }, "const.spyOn.mockImplementation": { "prefix": "csi", - "body": "const {$2:method}Spy = vi.spyOn({$1:global}, '{$2:method}')).mockImplementation(() => $0)", + "body": "const ${2:method}Spy = vi.spyOn(${1:global}, '${2:method}')).mockImplementation(() => $0)", "description": "creates a spy variable for a vi.spyOn() with mock implementation" } }