Skip to content

Commit 3fd355e

Browse files
committed
Add Vue base snippet #63
1 parent 4587bff commit 3fd355e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: snippets/vitest/vue.code-snippets

+22
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,27 @@
1818
"}"
1919
],
2020
"description": "Vue Test Utils Component"
21+
},
22+
"Vitest Vue Base": {
23+
"prefix": "vibase-vue",
24+
"body": [
25+
"import type { VueWrapper } from '@vue/test-utils'",
26+
"import { mount } from '@vue/test-utils'",
27+
"import { afterEach, beforeEach, describe, expect } from 'vitest'",
28+
"import ${TM_FILENAME/\\..*//} from '~/components/${TM_FILENAME/\\..*//}.vue'",
29+
"",
30+
"describe('${TM_FILENAME/\\..*//}', () => {",
31+
"\tlet wrapper: VueWrapper",
32+
"\t",
33+
"\tbeforeEach(() => {",
34+
"\t\twrapper = mount(${TM_FILENAME/\\..*//})",
35+
"\t})",
36+
"\t",
37+
"\tafterEach(() => {",
38+
"\t\twrapper.unmount()",
39+
"\t})",
40+
"})"
41+
],
42+
"description": "Base for Vitest file for Vue component"
2143
}
2244
}

0 commit comments

Comments
 (0)