-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sfc.spec.ts
43 lines (37 loc) · 875 Bytes
/
sfc.spec.ts
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
import { describe, expect, it } from 'vitest'
import vue3 from '@vitejs/plugin-vue'
import compiler from '@vue/compiler-sfc'
import { SFCFluentPlugin } from '../../../src/vite'
import { compile } from './util'
describe('Vite SFC', () => {
it('generates custom block code', async () => {
// Arrange
// Act
const code = await compile({
plugins: [
vue3({
compiler,
}),
SFCFluentPlugin(),
],
}, '/fixtures/test.vue')
// Assert
expect(code).toMatchSnapshot()
})
it('supports custom blockType', async () => {
// Arrange
// Act
const code = await compile({
plugins: [
vue3({
compiler,
}),
SFCFluentPlugin({
blockType: 'i18n',
}),
],
}, '/fixtures/blockType.vue')
// Assert
expect(code).toMatchSnapshot()
})
})