@@ -21,10 +21,12 @@ describe('compile visitor', () => {
2121 it ( 'throws if visitor is not an object' , ( ) => {
2222 const expectedErr = new TypeError ( 'Visitor returned from `create` method must be an object' ) ;
2323 expect ( ( ) => ( addVisitorToCompiled as any ) ( ) ) . toThrow ( expectedErr ) ;
24+ // oxlint-disable typescript-eslint/no-confusing-void-expression
2425 expect ( ( ) => addVisitorToCompiled ( null ) ) . toThrow ( expectedErr ) ;
2526 expect ( ( ) => addVisitorToCompiled ( undefined ) ) . toThrow ( expectedErr ) ;
2627 expect ( ( ) => addVisitorToCompiled ( true as any ) ) . toThrow ( expectedErr ) ;
2728 expect ( ( ) => addVisitorToCompiled ( 'xyz' as any ) ) . toThrow ( expectedErr ) ;
29+ // oxlint-enable typescript-eslint/no-confusing-void-expression
2830 } ) ;
2931
3032 it ( 'throws if unknown visitor key' , ( ) => {
@@ -34,10 +36,12 @@ describe('compile visitor', () => {
3436
3537 it ( 'throws if visitor property is not a function' , ( ) => {
3638 const expectedErr = new TypeError ( "'Program' property of visitor object is not a function" ) ;
39+ // oxlint-disable typescript-eslint/no-confusing-void-expression
3740 expect ( ( ) => addVisitorToCompiled ( { Program : null } ) ) . toThrow ( expectedErr ) ;
3841 expect ( ( ) => addVisitorToCompiled ( { Program : undefined } ) ) . toThrow ( expectedErr ) ;
3942 expect ( ( ) => addVisitorToCompiled ( { Program : true } as any ) ) . toThrow ( expectedErr ) ;
4043 expect ( ( ) => addVisitorToCompiled ( { Program : { } } as any ) ) . toThrow ( expectedErr ) ;
44+ // oxlint-enable typescript-eslint/no-confusing-void-expression
4145 } ) ;
4246
4347 describe ( 'registers enter visitor' , ( ) => {
@@ -86,7 +90,7 @@ describe('compile visitor', () => {
8690 addVisitorToCompiled ( { EmptyStatement : enter , 'EmptyStatement:exit' : exit } ) ;
8791 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
8892
89- const node = { } ;
93+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
9094 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
9195 expect ( enter ) . toHaveBeenCalledWith ( node ) ;
9296 expect ( exit ) . toHaveBeenCalledWith ( node ) ;
@@ -99,7 +103,7 @@ describe('compile visitor', () => {
99103 addVisitorToCompiled ( { 'EmptyStatement:exit' : exit , EmptyStatement : enter } ) ;
100104 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
101105
102- const node = { } ;
106+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
103107 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
104108 expect ( enter ) . toHaveBeenCalledWith ( node ) ;
105109 expect ( exit ) . toHaveBeenCalledWith ( node ) ;
@@ -147,7 +151,7 @@ describe('compile visitor', () => {
147151
148152 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
149153
150- const node = { } ;
154+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
151155 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
152156 expect ( enter1 ) . toHaveBeenCalledWith ( node ) ;
153157 expect ( exit1 ) . toHaveBeenCalledWith ( node ) ;
@@ -169,7 +173,7 @@ describe('compile visitor', () => {
169173
170174 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
171175
172- const node = { } ;
176+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
173177 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
174178 expect ( enter1 ) . toHaveBeenCalledWith ( node ) ;
175179 expect ( exit1 ) . toHaveBeenCalledWith ( node ) ;
@@ -191,7 +195,7 @@ describe('compile visitor', () => {
191195
192196 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
193197
194- const node = { } ;
198+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
195199 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
196200 expect ( enter1 ) . toHaveBeenCalledWith ( node ) ;
197201 expect ( exit1 ) . toHaveBeenCalledWith ( node ) ;
@@ -213,7 +217,7 @@ describe('compile visitor', () => {
213217
214218 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
215219
216- const node = { } ;
220+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
217221 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
218222 expect ( enter1 ) . toHaveBeenCalledWith ( node ) ;
219223 expect ( exit1 ) . toHaveBeenCalledWith ( node ) ;
@@ -239,12 +243,12 @@ describe('compile visitor', () => {
239243
240244 const enterExit = compiledVisitor [ PROGRAM_TYPE_ID ] as EnterExit ;
241245
242- const enterNode = { } ;
246+ const enterNode = { type : 'Program' , start : 0 , end : 0 } ;
243247 enterExit . enter ( enterNode ) ;
244248 expect ( enter1 ) . toHaveBeenCalledWith ( enterNode ) ;
245249 expect ( enter2 ) . toHaveBeenCalledWith ( enterNode ) ;
246250
247- const exitNode = { } ;
251+ const exitNode = { type : 'Program' , start : 0 , end : 0 } ;
248252 enterExit . exit ( exitNode ) ;
249253 expect ( exit1 ) . toHaveBeenCalledWith ( exitNode ) ;
250254 expect ( exit2 ) . toHaveBeenCalledWith ( exitNode ) ;
@@ -263,12 +267,12 @@ describe('compile visitor', () => {
263267
264268 const enterExit = compiledVisitor [ PROGRAM_TYPE_ID ] as EnterExit ;
265269
266- const enterNode = { } ;
270+ const enterNode = { type : 'Program' , start : 0 , end : 0 } ;
267271 enterExit . enter ( enterNode ) ;
268272 expect ( enter1 ) . toHaveBeenCalledWith ( enterNode ) ;
269273 expect ( enter2 ) . toHaveBeenCalledWith ( enterNode ) ;
270274
271- const exitNode = { } ;
275+ const exitNode = { type : 'Program' , start : 0 , end : 0 } ;
272276 enterExit . exit ( exitNode ) ;
273277 expect ( exit1 ) . toHaveBeenCalledWith ( exitNode ) ;
274278 expect ( exit2 ) . toHaveBeenCalledWith ( exitNode ) ;
@@ -287,12 +291,12 @@ describe('compile visitor', () => {
287291
288292 const enterExit = compiledVisitor [ PROGRAM_TYPE_ID ] as EnterExit ;
289293
290- const enterNode = { } ;
294+ const enterNode = { type : 'Program' , start : 0 , end : 0 } ;
291295 enterExit . enter ( enterNode ) ;
292296 expect ( enter1 ) . toHaveBeenCalledWith ( enterNode ) ;
293297 expect ( enter2 ) . toHaveBeenCalledWith ( enterNode ) ;
294298
295- const exitNode = { } ;
299+ const exitNode = { type : 'Program' , start : 0 , end : 0 } ;
296300 enterExit . exit ( exitNode ) ;
297301 expect ( exit1 ) . toHaveBeenCalledWith ( exitNode ) ;
298302 expect ( exit2 ) . toHaveBeenCalledWith ( exitNode ) ;
@@ -311,12 +315,12 @@ describe('compile visitor', () => {
311315
312316 const enterExit = compiledVisitor [ PROGRAM_TYPE_ID ] as EnterExit ;
313317
314- const enterNode = { } ;
318+ const enterNode = { type : 'Program' , start : 0 , end : 0 } ;
315319 enterExit . enter ( enterNode ) ;
316320 expect ( enter1 ) . toHaveBeenCalledWith ( enterNode ) ;
317321 expect ( enter2 ) . toHaveBeenCalledWith ( enterNode ) ;
318322
319- const exitNode = { } ;
323+ const exitNode = { type : 'Program' , start : 0 , end : 0 } ;
320324 enterExit . exit ( exitNode ) ;
321325 expect ( exit1 ) . toHaveBeenCalledWith ( exitNode ) ;
322326 expect ( exit2 ) . toHaveBeenCalledWith ( exitNode ) ;
@@ -350,7 +354,7 @@ describe('compile visitor', () => {
350354
351355 expect ( finalizeCompiledVisitor ( ) ) . toBe ( true ) ;
352356
353- const node = { } ;
357+ const node = { type : 'EmptyStatement' , start : 0 , end : 0 } ;
354358 ( compiledVisitor [ EMPTY_STMT_TYPE_ID ] as VisitFn ) ( node ) ;
355359
356360 expect ( enter1 ) . toHaveBeenCalledWith ( node ) ;
0 commit comments