Skip to content

Commit

Permalink
test(integrate-module): add compiled .js file spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jun 28, 2024
1 parent 014cf6a commit c73a516
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/integrate-module/src/compiled.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare class CompiledClass {
name: string
}
5 changes: 5 additions & 0 deletions packages/integrate-module/src/compiled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class CompiledClass {
constructor() {
this.name = 'CompiledClass'
}
}
6 changes: 6 additions & 0 deletions packages/integrate-module/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import test from 'node:test'

import { supportedExtensions } from 'file-type'

import { CompiledClass } from './compiled.js'
import { foo } from './foo.mjs'
import { bar } from './subdirectory/bar.mjs'
import { baz } from './subdirectory/index.mjs'
Expand All @@ -29,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')
})

0 comments on commit c73a516

Please sign in to comment.