MCPcopy
hub / github.com/vuejs/core / assertCode

Function assertCode

packages/compiler-sfc/__tests__/utils.ts:27–42  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

25}
26
27export function assertCode(code: string): void {
28 // parse the generated code to make sure it is valid
29 try {
30 babelParse(code, {
31 sourceType: 'module',
32 plugins: [
33 'typescript',
34 ['importAttributes', { deprecatedAssertSyntax: true }],
35 ],
36 })
37 } catch (e: any) {
38 console.log(code)
39 throw e
40 }
41 expect(code).toMatchSnapshot()
42}
43
44interface Pos {
45 line: number

Calls

no outgoing calls

Tested by

no test coverage detected