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 d319d1e commit c5c009f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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'
}
}
7 changes: 6 additions & 1 deletion packages/integrate-module/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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')
})

0 comments on commit c5c009f

Please sign in to comment.