test: typescript definitions
This commit is contained in:
parent
430b749519
commit
41ac57fa40
2 changed files with 30 additions and 0 deletions
|
|
@ -11,3 +11,15 @@ function getAddress(person: Person): Address {
|
|||
function getFirstAddress(people: Person[]): Address {
|
||||
return people[0].address;
|
||||
}
|
||||
|
||||
function logPerson(person: Person) {
|
||||
console.log(`Name: ${person.name}, Age: ${person.age}`);
|
||||
}
|
||||
|
||||
function getHardcodedAddress(): Address {
|
||||
return { street: "123 Main St", city: "Anytown", zipCode: "12345" };
|
||||
}
|
||||
|
||||
function getAddresses(people: Person[]): Address[] {
|
||||
return people[0].address;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,24 @@ export const TYPESCRIPT_TEST_CASES = [
|
|||
{ row: 10, column: 51 }, // Address
|
||||
],
|
||||
},
|
||||
{
|
||||
nodeType: "function_declaration without return type",
|
||||
fileName: "functions.ts",
|
||||
language: "TypeScript",
|
||||
cursorPosition: { line: 15, character: 58 },
|
||||
definitionPositions: [
|
||||
{ row: 14, column: 33 }, // Person
|
||||
],
|
||||
},
|
||||
{
|
||||
nodeType: "function_declaration without params",
|
||||
fileName: "functions.ts",
|
||||
language: "TypeScript",
|
||||
cursorPosition: { line: 19, character: 70 },
|
||||
definitionPositions: [
|
||||
{ row: 18, column: 39 }, // Person
|
||||
],
|
||||
},
|
||||
{
|
||||
nodeType: "method_declaration",
|
||||
fileName: "class.ts",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue