@@ -4,9 +4,9 @@ import { resolveOptions } from '../src/core/options'
4
4
5
5
describe ( 'transform' , async ( ) => {
6
6
const options = resolveOptions ( { } )
7
- const markdownToVue = await createMarkdown ( options )
7
+ const markdownToVue = createMarkdown ( options )
8
8
9
- it ( 'basic' , ( ) => {
9
+ it ( 'basic' , async ( ) => {
10
10
const md = `---
11
11
title: Hey
12
12
---
@@ -17,39 +17,39 @@ title: Hey
17
17
- B
18
18
- C
19
19
`
20
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
20
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
21
21
} )
22
22
23
- it ( 'style' , ( ) => {
23
+ it ( 'style' , async ( ) => {
24
24
const md = `
25
25
# Hello
26
26
27
27
<style>h1 { color: red }</style>
28
28
`
29
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
29
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
30
30
} )
31
31
32
- it ( 'script setup' , ( ) => {
32
+ it ( 'script setup' , async ( ) => {
33
33
const md = `
34
34
# Hello
35
35
36
36
<script setup lang="ts">
37
37
import Foo from './Foo.vue'
38
38
</script>
39
39
`
40
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
40
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
41
41
} )
42
42
43
- it ( 'exposes frontmatter' , ( ) => {
43
+ it ( 'exposes frontmatter' , async ( ) => {
44
44
const md = `---
45
45
title: Hey
46
46
---
47
47
48
48
# Hello`
49
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
49
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
50
50
} )
51
51
52
- it ( 'couldn\'t expose frontmatter' , ( ) => {
52
+ it ( 'couldn\'t expose frontmatter' , async ( ) => {
53
53
const md = `---
54
54
title: Hey
55
55
---
@@ -58,21 +58,21 @@ title: Hey
58
58
defineExpose({ test: 'test'})
59
59
</script>
60
60
`
61
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
61
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
62
62
} )
63
63
64
- it ( 'escapeCodeTagInterpolation' , ( ) => {
64
+ it ( 'escapeCodeTagInterpolation' , async ( ) => {
65
65
const md = `
66
66
<div>{{hello}}</div>
67
67
68
68
\`\`\`ts
69
69
<div>{{hello}}</div>
70
70
\`\`\`
71
71
`
72
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
72
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
73
73
} )
74
74
75
- it ( 'frontmatter interpolation' , ( ) => {
75
+ it ( 'frontmatter interpolation' , async ( ) => {
76
76
const md = `
77
77
---
78
78
name: 'My Cool App'
@@ -82,10 +82,10 @@ name: 'My Cool App'
82
82
83
83
This is {{frontmatter.name}}
84
84
`
85
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
85
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
86
86
} )
87
87
88
- it ( 'vue directives' , ( ) => {
88
+ it ( 'vue directives' , async ( ) => {
89
89
const md = `
90
90
---
91
91
name: 'My Cool App'
@@ -99,10 +99,10 @@ function onClick() {
99
99
100
100
<button @click="onClick"></button>
101
101
`
102
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
102
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
103
103
} )
104
104
105
- it ( 'export keyword frontmatters' , ( ) => {
105
+ it ( 'export keyword frontmatters' , async ( ) => {
106
106
const md = `
107
107
---
108
108
class: 'text'
@@ -111,17 +111,17 @@ default: 'foo'
111
111
112
112
Hello
113
113
`
114
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
114
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
115
115
} )
116
116
117
- it ( 'code escape' , ( ) => {
117
+ it ( 'code escape' , async ( ) => {
118
118
const md = `
119
119
Hello \`{{ world }}\`
120
120
121
121
\`\`\`js
122
122
console.log(\`{{ world }}\`)
123
123
\`\`\`
124
124
`
125
- expect ( markdownToVue ( '' , md ) . code ) . toMatchSnapshot ( )
125
+ expect ( ( await markdownToVue ( '' , md ) ) . code ) . toMatchSnapshot ( )
126
126
} )
127
127
} )
0 commit comments