( source: string, options?: Partial<SFCStyleCompileOptions>, )
| 6 | import path from 'node:path' |
| 7 | |
| 8 | export function compileScoped( |
| 9 | source: string, |
| 10 | options?: Partial<SFCStyleCompileOptions>, |
| 11 | ): string { |
| 12 | const res = compileStyle({ |
| 13 | source, |
| 14 | filename: 'test.css', |
| 15 | id: 'data-v-test', |
| 16 | scoped: true, |
| 17 | ...options, |
| 18 | }) |
| 19 | if (res.errors.length) { |
| 20 | res.errors.forEach(err => { |
| 21 | console.error(err) |
| 22 | }) |
| 23 | expect(res.errors.length).toBe(0) |
| 24 | } |
| 25 | return res.code |
| 26 | } |
| 27 | |
| 28 | describe('SFC scoped CSS', () => { |
| 29 | test('simple selectors', () => { |
no test coverage detected