File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,5 +287,29 @@ describe('Module Helpers', () => {
287287
288288 await expect ( project . serializeOutput ( ) ) . resolves . toContain ( expectedText ) ;
289289 } ) ;
290+
291+ it ( 'should add preset' , async ( ) => {
292+ const project = new TestProject ( ) ;
293+ project . addFile (
294+ 'entrypoints/background.ts' ,
295+ `export default defineBackground(() => {
296+ customImport();
297+ });` ,
298+ ) ;
299+ project . addFile (
300+ 'modules/test.ts' ,
301+ `import { defineWxtModule, addImportPreset } from 'wxt/modules';
302+
303+ export default defineWxtModule((wxt) => {
304+ addImportPreset(wxt, "vue");
305+ })` ,
306+ ) ;
307+
308+ await project . build ( ) ;
309+
310+ await expect (
311+ project . serializeFile ( '.wxt/types/imports.d.ts' ) ,
312+ ) . resolves . toContain ( "const ref: typeof import('vue')['ref']" ) ;
313+ } ) ;
290314 } ) ;
291315} ) ;
You can’t perform that action at this time.
0 commit comments