diff --git a/packages/integrate-module/src/compiled.d.ts b/packages/integrate-module/src/compiled.d.ts new file mode 100644 index 000000000..d9913f520 --- /dev/null +++ b/packages/integrate-module/src/compiled.d.ts @@ -0,0 +1,3 @@ +export declare class CompiledClass { + name: string +} diff --git a/packages/integrate-module/src/compiled.js b/packages/integrate-module/src/compiled.js new file mode 100644 index 000000000..3caad40f7 --- /dev/null +++ b/packages/integrate-module/src/compiled.js @@ -0,0 +1,5 @@ +export class CompiledClass { + constructor() { + this.name = 'CompiledClass' + } +} diff --git a/packages/integrate-module/src/index.ts b/packages/integrate-module/src/index.ts index e21665746..1df3f6f77 100644 --- a/packages/integrate-module/src/index.ts +++ b/packages/integrate-module/src/index.ts @@ -2,9 +2,9 @@ import assert from 'node:assert' import test from 'node:test' +import { bar as subBar } from '@subdirectory/bar.mjs' import { supportedExtensions } from 'file-type' -import { bar as subBar } from '@subdirectory/bar.mjs' import { CompiledClass } from './compiled.js' import { foo } from './foo.mjs' import { bar } from './subdirectory/bar.mjs' @@ -30,3 +30,8 @@ await test('resolve nested entry point', () => { await test('resolve paths', () => { assert.equal(subBar(), 'bar') }) + +await test('compiled js file with .d.ts', () => { + const instance = new CompiledClass() + assert.equal(instance.name, 'CompiledClass') +})