@@ -25,18 +25,10 @@ describe("Query subject", function () {
25
25
26
26
it ( "* subject" , function ( ) {
27
27
var matches = esquery ( forLoop , '!* > [name="foo"]' ) ;
28
- assert . strictEqual ( 10 , matches . length ) ;
28
+ assert . strictEqual ( 2 , matches . length ) ;
29
29
assert . deepEqual ( [
30
- forLoop . body [ 0 ] . test . right . object ,
31
30
forLoop . body [ 0 ] . test . right ,
32
- forLoop . body [ 0 ] . test ,
33
- forLoop . body [ 0 ] ,
34
- forLoop ,
35
- forLoop . body [ 0 ] . body . body [ 0 ] . expression . callee . object ,
36
31
forLoop . body [ 0 ] . body . body [ 0 ] . expression . callee ,
37
- forLoop . body [ 0 ] . body . body [ 0 ] . expression ,
38
- forLoop . body [ 0 ] . body . body [ 0 ] ,
39
- forLoop . body [ 0 ] . body ,
40
32
] , matches ) ;
41
33
} ) ;
42
34
@@ -45,8 +37,8 @@ describe("Query subject", function () {
45
37
assert . strictEqual ( 3 , matches . length ) ;
46
38
assert . deepEqual ( [
47
39
simpleFunction . body [ 0 ] ,
48
- simpleFunction . body [ 0 ] . body . body [ 0 ] . declarations [ 0 ] ,
49
40
simpleFunction . body [ 0 ] . body . body [ 0 ] ,
41
+ simpleFunction . body [ 0 ] . body . body [ 0 ] . declarations [ 0 ] ,
50
42
] , matches ) ;
51
43
} ) ;
52
44
@@ -97,28 +89,18 @@ describe("Query subject", function () {
97
89
98
90
it ( ":matches subject" , function ( ) {
99
91
var matches = esquery ( forLoop , '!:matches(*) > [name="foo"]' ) ;
100
- assert . strictEqual ( 10 , matches . length ) ;
92
+ assert . strictEqual ( 2 , matches . length ) ;
101
93
assert . deepEqual ( [
102
- forLoop . body [ 0 ] . test . right . object ,
103
94
forLoop . body [ 0 ] . test . right ,
104
- forLoop . body [ 0 ] . test ,
105
- forLoop . body [ 0 ] ,
106
- forLoop ,
107
- forLoop . body [ 0 ] . body . body [ 0 ] . expression . callee . object ,
108
95
forLoop . body [ 0 ] . body . body [ 0 ] . expression . callee ,
109
- forLoop . body [ 0 ] . body . body [ 0 ] . expression ,
110
- forLoop . body [ 0 ] . body . body [ 0 ] ,
111
- forLoop . body [ 0 ] . body ,
112
96
] , matches ) ;
113
97
} ) ;
114
98
115
99
it ( ":not subject" , function ( ) {
116
100
var matches = esquery ( nestedFunctions , '!:not(BlockStatement) > [name="foo"]' ) ;
117
- assert . strictEqual ( 3 , matches . length ) ;
101
+ assert . strictEqual ( 1 , matches . length ) ;
118
102
assert . deepEqual ( [
119
- nestedFunctions . body [ 0 ] . id ,
120
103
nestedFunctions . body [ 0 ] ,
121
- nestedFunctions ,
122
104
] , matches ) ;
123
105
} ) ;
124
106
0 commit comments