Skip to content

Commit 10c5ac2

Browse files
committed
fix(core): test
1 parent 054775b commit 10c5ac2

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

packages/utils/src/from-md/index.test.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,45 @@ describe('scriptFrom', () => {
1313
`)
1414

1515
expect(result).toMatchObject({
16-
remainingHTML: `
16+
template: `
1717
<template>
1818
<div>
1919
<h1>Hello, world!</h1>
2020
</div>
2121
</template>
22+
`,
23+
})
24+
})
25+
26+
it('should be able to parse with script', () => {
27+
const result = scriptFrom(`
28+
<script setup>
29+
import { ref } from 'vue'
30+
const count = ref(0)
31+
</script>
32+
33+
<template>
34+
<div>
35+
<h1>Hello, world!</h1>
36+
<p>Count: {{ count }}</p>
37+
</div>
38+
</template>
39+
`)
40+
41+
expect(result).toMatchObject({
42+
script: `
43+
import { ref } from 'vue'
44+
const count = ref(0)
45+
`,
46+
template: `
47+
48+
49+
<template>
50+
<div>
51+
<h1>Hello, world!</h1>
52+
<p>Count: {{ count }}</p>
53+
</div>
54+
</template>
2255
`,
2356
})
2457
})

0 commit comments

Comments
 (0)