Skip to content

Commit

Permalink
add exports types test
Browse files Browse the repository at this point in the history
  • Loading branch information
promer94 committed Jul 9, 2023
1 parent cca4b23 commit 6446b2a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ const testCases: {
}
},
},
{
name: 'ts-exports-types',
args: [],
async expected(dir) {
const distFiles = [
join(dir, './dist/index.mjs'),
join(dir, './dist/index.cjs'),
join(dir, './dist/index.d.mts'),
join(dir, './dist/index.d.cts'),
join(dir, './dist/index.d.ts'),
]
for (const f of distFiles) {
expect(await existsFile(f)).toBe(true)
}
},
},
{
name: 'single-entry',
args: [],
Expand Down
8 changes: 8 additions & 0 deletions test/integration/ts-exports-types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ts-dual-esm-cjs",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
}
1 change: 1 addition & 0 deletions test/integration/ts-exports-types/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => 'index'
5 changes: 5 additions & 0 deletions test/integration/ts-exports-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"allowJs": true
}
}

0 comments on commit 6446b2a

Please sign in to comment.