diff --git a/test/integration/dual-entry/index.test.ts b/test/integration/dual-entry/index.test.ts new file mode 100644 index 00000000..8ac104e7 --- /dev/null +++ b/test/integration/dual-entry/index.test.ts @@ -0,0 +1,20 @@ +import fs from 'fs' +import { assertFilesContent, createIntegrationTest } from '../utils' + +describe('integration tsconfig-override', () => { + it('should not generate js types paths if not specified', async () => { + await createIntegrationTest( + { + directory: __dirname, + }, + async ({ dir }) => { + assertFilesContent(dir, { + './dist/subpath/nested.js': 'subpath/nested', + './dist/subpath/nested.cjs': 'subpath/nested', + }) + const subpathTypes = await import(`${dir}/dist/index.js`) + expect(fs.existsSync(subpathTypes)).toBe(false) + }, + ) + }) +}) diff --git a/test/integration/dual-entry/package.json b/test/integration/dual-entry/package.json new file mode 100644 index 00000000..36620395 --- /dev/null +++ b/test/integration/dual-entry/package.json @@ -0,0 +1,10 @@ +{ + "name": "undefined-types-paths", + "type": "module", + "exports": { + "./a": { + "workerd": "./dist/a.workerd.js", + "import": "./dist/a.js" + } + } +} diff --git a/test/integration/dual-entry/src/a.ts b/test/integration/dual-entry/src/a.ts new file mode 100644 index 00000000..9c2840e2 --- /dev/null +++ b/test/integration/dual-entry/src/a.ts @@ -0,0 +1 @@ +export { internal } from './a/shared' diff --git a/test/integration/dual-entry/src/a.workerd.ts b/test/integration/dual-entry/src/a.workerd.ts new file mode 100644 index 00000000..9c2840e2 --- /dev/null +++ b/test/integration/dual-entry/src/a.workerd.ts @@ -0,0 +1 @@ +export { internal } from './a/shared' diff --git a/test/integration/dual-entry/src/a/shared.ts b/test/integration/dual-entry/src/a/shared.ts new file mode 100644 index 00000000..b13d8e9f --- /dev/null +++ b/test/integration/dual-entry/src/a/shared.ts @@ -0,0 +1 @@ +export const internal = 'a'