-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ast-spec): add fixtures for
const
modifiers
- Loading branch information
1 parent
325bc96
commit ba79f83
Showing
177 changed files
with
13,935 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ges/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.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 @@ | ||
<const T extends U>() => {}; |
101 changes: 101 additions & 0 deletions
101
...ecial/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot
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,101 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends TSESTree - AST 1`] = ` | ||
Program { | ||
type: "Program", | ||
body: Array [ | ||
ExpressionStatement { | ||
type: "ExpressionStatement", | ||
expression: ArrowFunctionExpression { | ||
type: "ArrowFunctionExpression", | ||
async: false, | ||
body: BlockStatement { | ||
type: "BlockStatement", | ||
body: Array [], | ||
range: [25, 27], | ||
loc: { | ||
start: { column: 25, line: 1 }, | ||
end: { column: 27, line: 1 }, | ||
}, | ||
}, | ||
expression: false, | ||
generator: false, | ||
id: null, | ||
params: Array [], | ||
typeParameters: TSTypeParameterDeclaration { | ||
type: "TSTypeParameterDeclaration", | ||
params: Array [ | ||
TSTypeParameter { | ||
type: "TSTypeParameter", | ||
const: true, | ||
constraint: TSTypeReference { | ||
type: "TSTypeReference", | ||
typeName: Identifier { | ||
type: "Identifier", | ||
name: "U", | ||
range: [17, 18], | ||
loc: { | ||
start: { column: 17, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
range: [17, 18], | ||
loc: { | ||
start: { column: 17, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
in: false, | ||
name: Identifier { | ||
type: "Identifier", | ||
name: "T", | ||
range: [7, 8], | ||
loc: { | ||
start: { column: 7, line: 1 }, | ||
end: { column: 8, line: 1 }, | ||
}, | ||
}, | ||
out: false, | ||
range: [1, 18], | ||
loc: { | ||
start: { column: 1, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
], | ||
range: [0, 19], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 19, line: 1 }, | ||
}, | ||
}, | ||
range: [0, 27], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 27, line: 1 }, | ||
}, | ||
}, | ||
range: [0, 28], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 28, line: 1 }, | ||
}, | ||
}, | ||
], | ||
sourceType: "script", | ||
range: [0, 29], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 0, line: 2 }, | ||
}, | ||
} | ||
`; |
126 changes: 126 additions & 0 deletions
126
...al/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot
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,126 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends TSESTree - Tokens 1`] = ` | ||
Array [ | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "<", | ||
range: [0, 1], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 1, line: 1 }, | ||
}, | ||
}, | ||
Keyword { | ||
type: "Keyword", | ||
value: "const", | ||
range: [1, 6], | ||
loc: { | ||
start: { column: 1, line: 1 }, | ||
end: { column: 6, line: 1 }, | ||
}, | ||
}, | ||
Identifier { | ||
type: "Identifier", | ||
value: "T", | ||
range: [7, 8], | ||
loc: { | ||
start: { column: 7, line: 1 }, | ||
end: { column: 8, line: 1 }, | ||
}, | ||
}, | ||
Keyword { | ||
type: "Keyword", | ||
value: "extends", | ||
range: [9, 16], | ||
loc: { | ||
start: { column: 9, line: 1 }, | ||
end: { column: 16, line: 1 }, | ||
}, | ||
}, | ||
Identifier { | ||
type: "Identifier", | ||
value: "U", | ||
range: [17, 18], | ||
loc: { | ||
start: { column: 17, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: ">", | ||
range: [18, 19], | ||
loc: { | ||
start: { column: 18, line: 1 }, | ||
end: { column: 19, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "(", | ||
range: [19, 20], | ||
loc: { | ||
start: { column: 19, line: 1 }, | ||
end: { column: 20, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: ")", | ||
range: [20, 21], | ||
loc: { | ||
start: { column: 20, line: 1 }, | ||
end: { column: 21, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "=>", | ||
range: [22, 24], | ||
loc: { | ||
start: { column: 22, line: 1 }, | ||
end: { column: 24, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "{", | ||
range: [25, 26], | ||
loc: { | ||
start: { column: 25, line: 1 }, | ||
end: { column: 26, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: "}", | ||
range: [26, 27], | ||
loc: { | ||
start: { column: 26, line: 1 }, | ||
end: { column: 27, line: 1 }, | ||
}, | ||
}, | ||
Punctuator { | ||
type: "Punctuator", | ||
value: ";", | ||
range: [27, 28], | ||
loc: { | ||
start: { column: 27, line: 1 }, | ||
end: { column: 28, line: 1 }, | ||
}, | ||
}, | ||
] | ||
`; |
90 changes: 90 additions & 0 deletions
90
.../special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/3-Babel-AST.shot
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,90 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends Babel - AST 1`] = ` | ||
Program { | ||
type: "Program", | ||
body: Array [ | ||
ExpressionStatement { | ||
type: "ExpressionStatement", | ||
expression: ArrowFunctionExpression { | ||
type: "ArrowFunctionExpression", | ||
async: false, | ||
body: BlockStatement { | ||
type: "BlockStatement", | ||
body: Array [], | ||
range: [25, 27], | ||
loc: { | ||
start: { column: 25, line: 1 }, | ||
end: { column: 27, line: 1 }, | ||
}, | ||
}, | ||
expression: false, | ||
generator: false, | ||
id: null, | ||
params: Array [], | ||
typeParameters: TSTypeParameterDeclaration { | ||
type: "TSTypeParameterDeclaration", | ||
params: Array [ | ||
TSTypeParameter { | ||
type: "TSTypeParameter", | ||
const: true, | ||
constraint: TSTypeReference { | ||
type: "TSTypeReference", | ||
typeName: Identifier { | ||
type: "Identifier", | ||
name: "U", | ||
range: [17, 18], | ||
loc: { | ||
start: { column: 17, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
range: [17, 18], | ||
loc: { | ||
start: { column: 17, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
name: "T", | ||
range: [1, 18], | ||
loc: { | ||
start: { column: 1, line: 1 }, | ||
end: { column: 18, line: 1 }, | ||
}, | ||
}, | ||
], | ||
range: [0, 19], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 19, line: 1 }, | ||
}, | ||
}, | ||
range: [0, 27], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 27, line: 1 }, | ||
}, | ||
}, | ||
range: [0, 28], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 28, line: 1 }, | ||
}, | ||
}, | ||
], | ||
sourceType: "script", | ||
range: [0, 29], | ||
loc: { | ||
start: { column: 0, line: 1 }, | ||
end: { column: 0, line: 2 }, | ||
}, | ||
} | ||
`; |
Oops, something went wrong.