@@ -118,7 +118,7 @@ describe('module builder', () => {
118
118
119
119
it ( 'should generate typed plugin' , async ( ) => {
120
120
const pluginDts = await readFile ( join ( distDir , 'runtime/plugins/plugin.d.ts' ) , 'utf-8' )
121
- expect ( pluginDts ) . toMatchFileSnapshot ( '__snapshots__/plugin.d.ts' )
121
+ await expect ( pluginDts ) . toMatchFileSnapshot ( '__snapshots__/plugin.d.ts' )
122
122
} )
123
123
124
124
it ( 'should correctly add extensions to imports from runtime/ directory' , async ( ) => {
@@ -130,20 +130,20 @@ describe('module builder', () => {
130
130
// TODO: https://github.com/nuxt/module-builder/issues/239
131
131
it ( 'should generate components correctly' , async ( ) => {
132
132
const componentFile = await readFile ( join ( distDir , 'runtime/components/TestMe.vue' ) , 'utf-8' )
133
- expect ( componentFile . replace ( / \r \n / g, '\n' ) ) . toMatchFileSnapshot ( '__snapshots__/TestMe.vue' )
133
+ await expect ( componentFile . replace ( / \r \n / g, '\n' ) ) . toMatchFileSnapshot ( '__snapshots__/TestMe.vue' )
134
134
} )
135
135
136
136
it ( 'should generate wrapped composables' , async ( ) => {
137
137
const componentFile = await readFile ( join ( distDir , 'runtime/composables/useWrappedFetch.d.ts' ) , 'utf-8' )
138
- expect ( componentFile ) . toMatchFileSnapshot ( '__snapshots__/useWrappedFetch.d.ts' )
138
+ await expect ( componentFile ) . toMatchFileSnapshot ( '__snapshots__/useWrappedFetch.d.ts' )
139
139
} )
140
140
141
141
it ( 'should handle JSX correctly' , async ( ) => {
142
142
const [ component , declaration ] = await Promise . all ( [
143
143
readFile ( join ( distDir , 'runtime/components/JsxComponent.js' ) , 'utf-8' ) ,
144
144
readFile ( join ( distDir , 'runtime/components/JsxComponent.d.ts' ) , 'utf-8' ) ,
145
145
] )
146
- expect ( component ) . toMatchFileSnapshot ( '__snapshots__/JsxComponent.js' )
147
- expect ( declaration ) . toMatchFileSnapshot ( '__snapshots__/JsxComponent.d.ts' )
146
+ await expect ( component ) . toMatchFileSnapshot ( '__snapshots__/JsxComponent.js' )
147
+ await expect ( declaration ) . toMatchFileSnapshot ( '__snapshots__/JsxComponent.d.ts' )
148
148
} )
149
149
} )
0 commit comments