From 95aa8cb06dba7358551b4726040e583220878e1e Mon Sep 17 00:00:00 2001 From: JaCraig Date: Wed, 23 Oct 2024 10:53:07 -0400 Subject: [PATCH] fix(typescript): adding test --- packages/typescript/test/test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/typescript/test/test.js b/packages/typescript/test/test.js index e0b83fd0d..1758779f0 100644 --- a/packages/typescript/test/test.js +++ b/packages/typescript/test/test.js @@ -129,6 +129,28 @@ test.serial( } ); +test.serial( + 'ensures declarationDir is allowed in Rollup output directory when output.file is used', + async (t) => { + const bundle = await rollup({ + input: 'fixtures/basic/main.ts', + plugins: [ + typescript({ + tsconfig: 'fixtures/basic/tsconfig.json', + declarationDir: 'fixtures/basic/dist/other', + declaration: true + }) + ], + onwarn + }); + + // this should not throw an error + await t.notThrowsAsync(() => + getCode(bundle, { format: 'es', file: 'fixtures/basic/dist/index.js' }, true) + ); + } +); + test.serial( 'ensures output files can be written to subdirectories within the tsconfig outDir', async (t) => {