add espree comment attachment tests and remove ranges test property from babylon tests
This commit is contained in:
10
test/fixtures/comments/basic/export-default-anonymous-class/actual.js
vendored
Executable file
10
test/fixtures/comments/basic/export-default-anonymous-class/actual.js
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* this is anonymous class.
|
||||
*/
|
||||
export default class {
|
||||
/**
|
||||
* this is method1.
|
||||
*/
|
||||
method1(){
|
||||
}
|
||||
}
|
||||
233
test/fixtures/comments/basic/export-default-anonymous-class/expected.json
vendored
Executable file
233
test/fixtures/comments/basic/export-default-anonymous-class/expected.json
vendored
Executable file
@@ -0,0 +1,233 @@
|
||||
{
|
||||
"type": "File",
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportDefaultDeclaration",
|
||||
"declaration": {
|
||||
"type": "ClassExpression",
|
||||
"id": null,
|
||||
"superClass": null,
|
||||
"body": {
|
||||
"type": "ClassBody",
|
||||
"body": [
|
||||
{
|
||||
"type": "MethodDefinition",
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"name": "method1",
|
||||
"range": [
|
||||
103,
|
||||
110
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 8,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "FunctionExpression",
|
||||
"id": null,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"body": [],
|
||||
"range": [
|
||||
112,
|
||||
119
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"range": [
|
||||
110,
|
||||
119
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"kind": "method",
|
||||
"computed": false,
|
||||
"range": [
|
||||
103,
|
||||
119
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 8,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": "*\n * this is method1.\n ",
|
||||
"range": [
|
||||
63,
|
||||
98
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"static": false
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
57,
|
||||
121
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
51,
|
||||
121
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
121
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": "*\n * this is anonymous class.\n ",
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"sourceType": "module",
|
||||
"range": [
|
||||
0,
|
||||
121
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 10,
|
||||
"column": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": "*\n * this is anonymous class.\n ",
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": "*\n * this is method1.\n ",
|
||||
"range": [
|
||||
63,
|
||||
98
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
3
test/fixtures/comments/basic/export-default-anonymous-class/options.json
vendored
Normal file
3
test/fixtures/comments/basic/export-default-anonymous-class/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
Reference in New Issue
Block a user