Skip to content

Commit

Permalink
test(ast-spec): add fixtures for const modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Mar 12, 2023
1 parent 325bc96 commit ba79f83
Show file tree
Hide file tree
Showing 177 changed files with 13,935 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<const T extends U>() => {};
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 },
},
}
`;
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 },
},
},
]
`;
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 },
},
}
`;

0 comments on commit ba79f83

Please sign in to comment.