Skip to content

Commit

Permalink
test(typescript): check for correct error for invalid declarationDir …
Browse files Browse the repository at this point in the history
…when using output.file
  • Loading branch information
lameuler committed Jun 3, 2024
1 parent 34dfc67 commit 0abc35f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/typescript/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,15 @@ test.serial(
});

// this should throw an error just like the equivalent setup using output.dir above
await t.throwsAsync(() =>
const wrongDirError = await t.throwsAsync(() =>
getCode(bundle, { format: 'es', file: 'fixtures/basic/dist/index.js' }, true)
);
// TODO add check for specific error message
t.true(
wrongDirError.message.includes(
`Path of Typescript compiler option 'declarationDir' must be located inside the same directory as the Rollup 'file' option`
),
`Unexpected error message: ${wrongDirError.message}`
);
}
);

Expand Down

0 comments on commit 0abc35f

Please sign in to comment.