Skip to content

Commit fa5ff8d

Browse files
committed
test(integrate-module): add compiled .js file spec
1 parent a1098be commit fa5ff8d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare class CompiledClass {
2+
name: string
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export class CompiledClass {
2+
constructor() {
3+
this.name = 'CompiledClass'
4+
}
5+
}

packages/integrate-module/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import test from 'node:test'
44

55
import { supportedExtensions } from 'file-type'
66

7+
import { CompiledClass } from './compiled.js'
78
import { foo } from './foo.mjs'
89
import { bar } from './subdirectory/bar.mjs'
910
import { baz } from './subdirectory/index.mjs'
@@ -29,3 +30,8 @@ await test('resolve nested entry point', () => {
2930
await test('resolve paths', () => {
3031
assert.equal(subBar(), 'bar')
3132
})
33+
34+
await test('compiled js file with .d.ts', () => {
35+
const instance = new CompiledClass()
36+
assert.equal(instance.name, 'CompiledClass')
37+
})

0 commit comments

Comments
 (0)