Skip to content

Commit

Permalink
test: add test for typecast completions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Golovin committed Oct 28, 2023
1 parent 8059588 commit e4b47c0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions typescript/test/completions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,3 +860,23 @@ test('In Keyword Completions', () => {
}
`)
})
describe('Typecast completions', () => {
test('As completions', () => {
const [pos] = newFileContents(/*ts*/ `
const b = 5
const a = b as /*|*/
`)
const completions = getCompletionsAtPosition(pos!)?.entriesSorted

expect(completions?.[0]?.name).toEqual('number')
})
test('jsDoc typecast', () => {
const [pos] = newFileContents(/*ts*/ `
const b = 5
const a = /** @type {/*|*/} */(b)
`)
const completions = getCompletionsAtPosition(pos!)?.entriesSorted

expect(completions?.[0]?.name).toEqual('number')
})
})

0 comments on commit e4b47c0

Please sign in to comment.