add espree comment attachment tests and remove ranges test property from babylon tests
This commit is contained in:
2
test/fixtures/comments/basic/comment-within-condition/actual.js
vendored
Executable file
2
test/fixtures/comments/basic/comment-within-condition/actual.js
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
/* foo */
|
||||
if (/* bar */ a) {}
|
||||
155
test/fixtures/comments/basic/comment-within-condition/expected.json
vendored
Executable file
155
test/fixtures/comments/basic/comment-within-condition/expected.json
vendored
Executable file
@@ -0,0 +1,155 @@
|
||||
{
|
||||
"type": "File",
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "IfStatement",
|
||||
"test": {
|
||||
"type": "Identifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
25,
|
||||
26
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " bar ",
|
||||
"range": [
|
||||
14,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"consequent": {
|
||||
"type": "BlockStatement",
|
||||
"body": [],
|
||||
"range": [
|
||||
28,
|
||||
30
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"alternate": null,
|
||||
"range": [
|
||||
10,
|
||||
30
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " foo ",
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"sourceType": "script",
|
||||
"range": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " foo ",
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " bar ",
|
||||
"range": [
|
||||
14,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user