@@ -37,14 +37,14 @@ test.describe('analyzeTsFile', () => {
3737 // Sort events by line number for consistent ordering
3838 events . sort ( ( a , b ) => a . line - b . line ) ;
3939
40- assert . strictEqual ( events . length , 20 ) ;
40+ assert . strictEqual ( events . length , 23 ) ;
4141
4242 // Test Google Analytics event
4343 const gaEvent = events . find ( e => e . eventName === 'order_completed' && e . source === 'googleanalytics' ) ;
4444 assert . ok ( gaEvent ) ;
4545 assert . strictEqual ( gaEvent . source , 'googleanalytics' ) ;
4646 assert . strictEqual ( gaEvent . functionName , 'trackOrderCompletedGA' ) ;
47- assert . strictEqual ( gaEvent . line , 105 ) ;
47+ assert . strictEqual ( gaEvent . line , 119 ) ;
4848 assert . deepStrictEqual ( gaEvent . properties , {
4949 order_id : { type : 'string' } ,
5050 products : {
@@ -76,7 +76,7 @@ test.describe('analyzeTsFile', () => {
7676 assert . ok ( segmentEvent ) ;
7777 assert . strictEqual ( segmentEvent . source , 'segment' ) ;
7878 assert . strictEqual ( segmentEvent . functionName , 'checkout' ) ;
79- assert . strictEqual ( segmentEvent . line , 121 ) ;
79+ assert . strictEqual ( segmentEvent . line , 135 ) ;
8080 assert . deepStrictEqual ( segmentEvent . properties , {
8181 stage : { type : 'string' } ,
8282 method : { type : 'string' } ,
@@ -88,7 +88,7 @@ test.describe('analyzeTsFile', () => {
8888 assert . ok ( mixpanelEvent ) ;
8989 assert . strictEqual ( mixpanelEvent . source , 'mixpanel' ) ;
9090 assert . strictEqual ( mixpanelEvent . functionName , 'confirmPurchaseMixpanel' ) ;
91- assert . strictEqual ( mixpanelEvent . line , 130 ) ;
91+ assert . strictEqual ( mixpanelEvent . line , 144 ) ;
9292 assert . deepStrictEqual ( mixpanelEvent . properties , {
9393 order_id : { type : 'string' } ,
9494 items : {
@@ -111,7 +111,7 @@ test.describe('analyzeTsFile', () => {
111111 assert . ok ( amplitudeEvent ) ;
112112 assert . strictEqual ( amplitudeEvent . source , 'amplitude' ) ;
113113 assert . strictEqual ( amplitudeEvent . functionName , 'checkout' ) ;
114- assert . strictEqual ( amplitudeEvent . line , 135 ) ;
114+ assert . strictEqual ( amplitudeEvent . line , 149 ) ;
115115 assert . deepStrictEqual ( amplitudeEvent . properties , {
116116 order_id : { type : 'string' } ,
117117 items : {
@@ -143,7 +143,7 @@ test.describe('analyzeTsFile', () => {
143143 assert . ok ( rudderstackEvent ) ;
144144 assert . strictEqual ( rudderstackEvent . source , 'rudderstack' ) ;
145145 assert . strictEqual ( rudderstackEvent . functionName , 'checkout' ) ;
146- assert . strictEqual ( rudderstackEvent . line , 150 ) ;
146+ assert . strictEqual ( rudderstackEvent . line , 164 ) ;
147147 assert . deepStrictEqual ( rudderstackEvent . properties , {
148148 order_id : { type : 'string' } ,
149149 items : {
@@ -174,7 +174,7 @@ test.describe('analyzeTsFile', () => {
174174 assert . ok ( mparticleEvent ) ;
175175 assert . strictEqual ( mparticleEvent . source , 'mparticle' ) ;
176176 assert . strictEqual ( mparticleEvent . functionName , 'checkout2' ) ;
177- assert . strictEqual ( mparticleEvent . line , 176 ) ;
177+ assert . strictEqual ( mparticleEvent . line , 190 ) ;
178178 assert . deepStrictEqual ( mparticleEvent . properties , {
179179 order_id : { type : 'string' } ,
180180 items : {
@@ -205,7 +205,7 @@ test.describe('analyzeTsFile', () => {
205205 assert . ok ( posthogEvent ) ;
206206 assert . strictEqual ( posthogEvent . source , 'posthog' ) ;
207207 assert . strictEqual ( posthogEvent . functionName , 'checkout2' ) ;
208- assert . strictEqual ( posthogEvent . line , 195 ) ;
208+ assert . strictEqual ( posthogEvent . line , 209 ) ;
209209 assert . deepStrictEqual ( posthogEvent . properties , {
210210 order_id : { type : 'string' } ,
211211 retry : { type : 'number' } ,
@@ -237,7 +237,7 @@ test.describe('analyzeTsFile', () => {
237237 assert . ok ( pendoEvent ) ;
238238 assert . strictEqual ( pendoEvent . source , 'pendo' ) ;
239239 assert . strictEqual ( pendoEvent . functionName , 'checkout3' ) ;
240- assert . strictEqual ( pendoEvent . line , 216 ) ;
240+ assert . strictEqual ( pendoEvent . line , 230 ) ;
241241 assert . deepStrictEqual ( pendoEvent . properties , {
242242 order_id : { type : 'string' } ,
243243 products : {
@@ -268,7 +268,7 @@ test.describe('analyzeTsFile', () => {
268268 assert . ok ( heapEvent ) ;
269269 assert . strictEqual ( heapEvent . source , 'heap' ) ;
270270 assert . strictEqual ( heapEvent . functionName , 'checkout3' ) ;
271- assert . strictEqual ( heapEvent . line , 230 ) ;
271+ assert . strictEqual ( heapEvent . line , 244 ) ;
272272 assert . deepStrictEqual ( heapEvent . properties , {
273273 user_id : { type : 'string' } ,
274274 email : { type : 'string' } ,
@@ -284,7 +284,7 @@ test.describe('analyzeTsFile', () => {
284284 assert . ok ( snowplowEvent1 ) ;
285285 assert . strictEqual ( snowplowEvent1 . source , 'snowplow' ) ;
286286 assert . strictEqual ( snowplowEvent1 . functionName , 'trackSnowplow' ) ;
287- assert . strictEqual ( snowplowEvent1 . line , 247 ) ;
287+ assert . strictEqual ( snowplowEvent1 . line , 282 ) ;
288288 assert . deepStrictEqual ( snowplowEvent1 . properties , {
289289 category : { type : 'string' } ,
290290 label : { type : 'string' } ,
@@ -296,14 +296,14 @@ test.describe('analyzeTsFile', () => {
296296 assert . ok ( snowplowEvent2 ) ;
297297 assert . strictEqual ( snowplowEvent2 . source , 'snowplow' ) ;
298298 assert . strictEqual ( snowplowEvent2 . functionName , 'trackSnowplow2' ) ;
299- assert . strictEqual ( snowplowEvent2 . line , 251 ) ;
299+ assert . strictEqual ( snowplowEvent2 . line , 286 ) ;
300300
301301 // Test custom function event
302302 const customEvent = events . find ( e => e . eventName === 'custom_event_v2' ) ;
303303 assert . ok ( customEvent ) ;
304304 assert . strictEqual ( customEvent . source , 'custom' ) ;
305305 assert . strictEqual ( customEvent . functionName , 'global' ) ;
306- assert . strictEqual ( customEvent . line , 280 ) ;
306+ assert . strictEqual ( customEvent . line , 315 ) ;
307307 assert . deepStrictEqual ( customEvent . properties , {
308308 userId : { type : 'string' } ,
309309 order_id : { type : 'string' } ,
@@ -326,7 +326,7 @@ test.describe('analyzeTsFile', () => {
326326 assert . ok ( constantEvent ) ;
327327 assert . strictEqual ( constantEvent . source , 'custom' ) ;
328328 assert . strictEqual ( constantEvent . functionName , 'global' ) ;
329- assert . strictEqual ( constantEvent . line , 291 ) ;
329+ assert . strictEqual ( constantEvent . line , 326 ) ;
330330 assert . deepStrictEqual ( constantEvent . properties , {
331331 userId : { type : 'string' } ,
332332 orderId : { type : 'string' } ,
@@ -342,7 +342,7 @@ test.describe('analyzeTsFile', () => {
342342 assert . ok ( importedConstantEvent ) ;
343343 assert . strictEqual ( importedConstantEvent . source , 'segment' ) ;
344344 assert . strictEqual ( importedConstantEvent . functionName , 'global' ) ;
345- assert . strictEqual ( importedConstantEvent . line , 293 ) ;
345+ assert . strictEqual ( importedConstantEvent . line , 328 ) ;
346346 assert . deepStrictEqual ( importedConstantEvent . properties , {
347347 orderId : { type : 'string' } ,
348348 total : { type : 'number' } ,
@@ -357,7 +357,7 @@ test.describe('analyzeTsFile', () => {
357357 assert . ok ( frozenConstantEvent ) ;
358358 assert . strictEqual ( frozenConstantEvent . source , 'mixpanel' ) ;
359359 assert . strictEqual ( frozenConstantEvent . functionName , 'global' ) ;
360- assert . strictEqual ( frozenConstantEvent . line , 292 ) ;
360+ assert . strictEqual ( frozenConstantEvent . line , 327 ) ;
361361 assert . deepStrictEqual ( frozenConstantEvent . properties , {
362362 orderId : { type : 'string' } ,
363363 total : { type : 'number' } ,
@@ -405,7 +405,7 @@ test.describe('analyzeTsFile', () => {
405405 const events = analyzeTsFile ( testFilePath , program , null ) ;
406406
407407 // Should find all events except the custom ones
408- assert . strictEqual ( events . length , 13 ) ;
408+ assert . strictEqual ( events . length , 16 ) ;
409409 assert . strictEqual ( events . find ( e => e . source === 'custom' ) , undefined ) ;
410410 } ) ;
411411
0 commit comments