-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvue.code-snippets
44 lines (44 loc) · 1.1 KB
/
vue.code-snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
"Vitest Vue Mount": {
"prefix": "vimount",
"body": [
"const wrapper = mount(${0})",
],
"description": "Vue Test Utils Mount"
},
"Vitest Test Component": {
"prefix": "vicomponent",
"body": [
"{",
"\ttemplate: '${0}'",
"\t\tdata() {",
"\t\t\treturn {",
"\t\t${2:variable}",
"\t}",
"}"
],
"description": "Vue Test Utils Component"
},
"Vitest Vue Base": {
"prefix": "vibase-vue",
"body": [
"import type { VueWrapper } from '@vue/test-utils'",
"import { mount } from '@vue/test-utils'",
"import { afterEach, beforeEach, describe, expect } from 'vitest'",
"import ${TM_FILENAME/\\..*//} from '~/components/${TM_FILENAME/\\..*//}.vue'",
"",
"describe('${TM_FILENAME/\\..*//}', () => {",
"\tlet wrapper: VueWrapper",
"\t",
"\tbeforeEach(() => {",
"\t\twrapper = mount(${TM_FILENAME/\\..*//})",
"\t})",
"\t",
"\tafterEach(() => {",
"\t\twrapper.unmount()",
"\t})",
"})"
],
"description": "Base for Vitest file for Vue component"
}
}