Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,35 @@ describe('resolveType', () => {
})
expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})

test('global types with ambient references', () => {
const files = {
// with references
'/backend.d.ts': `
declare namespace App.Data {
export type AircraftData = {
id: string
manufacturer: App.Data.Listings.ManufacturerData
}
}
declare namespace App.Data.Listings {
export type ManufacturerData = {
id: string
}
}
`
}

const { props } = resolve(`defineProps<App.Data.AircraftData>()`, files, {
globalTypeFiles: Object.keys(files)
})

expect(props).toStrictEqual({
id: ['String']
// manufacturer: ['String'] // TODO
})
// expect(deps && [...deps]).toStrictEqual(Object.keys(files))
})
})

describe('errors', () => {
Expand Down