Skip to content

Commit 9fc6408

Browse files
committed
chore: Add E2E test for addImportPreset
1 parent 394cb1a commit 9fc6408

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

packages/wxt/e2e/tests/modules.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)