Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add printer branch for TSFirstTypeNode (#1332)
* add TSFirstTypeNode * add test for TSFirstTypeNode
- Loading branch information
1 parent
dc499ba
commit cb79d82
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/typescript/conformance/types/firstTypeNode/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`firstTypeNode.ts 1`] = ` | ||
export function fooWithTypePredicate(a: any): a is number { | ||
return true; | ||
} | ||
export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a is number { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndGeneric<T>(a: any): a is T { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is number { | ||
return true; | ||
} | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
export function fooWithTypePredicate(a: any): a is number { | ||
return true; | ||
} | ||
export function fooWithTypePredicateAndMulitpleParams( | ||
a: any, | ||
b: any, | ||
c: any | ||
): a is number { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndGeneric<T>(a: any): a is T { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndRestParam( | ||
a: any, | ||
...rest | ||
): a is number { | ||
return true; | ||
} | ||
`; |
12 changes: 12 additions & 0 deletions
12
tests/typescript/conformance/types/firstTypeNode/firstTypeNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function fooWithTypePredicate(a: any): a is number { | ||
return true; | ||
} | ||
export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a is number { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndGeneric<T>(a: any): a is T { | ||
return true; | ||
} | ||
export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is number { | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, { parser: "typescript" }); |