@@ -199,7 +199,7 @@ describe("EventsDatabase", function() {
199199 // We need to use `getAndValidatePingData` here,
200200 // because the public function will strip reserved extra keys.
201201 const rawRecordedEvent = ( await db [ "getAndValidatePingData" ] ( ping ) ) [ 0 ] ;
202- assert . strictEqual ( rawRecordedEvent . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
202+ assert . strictEqual ( rawRecordedEvent . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
203203 }
204204 } ) ;
205205
@@ -271,8 +271,8 @@ describe("EventsDatabase", function() {
271271 // We expect only two events here, restarted and the above. Execution counter 1.
272272 const rawRecordedEvents1 = ( await db [ "getAndValidatePingData" ] ( "aPing" ) ) ;
273273 assert . strictEqual ( rawRecordedEvents1 . length , 2 ) ;
274- assert . strictEqual ( rawRecordedEvents1 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
275- assert . strictEqual ( rawRecordedEvents1 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
274+ assert . strictEqual ( rawRecordedEvents1 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
275+ assert . strictEqual ( rawRecordedEvents1 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
276276
277277 // Fake restart Glean and record a new event.
278278 const restartedDb = new EventsDatabase ( Glean . platform . Storage ) ;
@@ -288,15 +288,15 @@ describe("EventsDatabase", function() {
288288 // the next two events are this run's restart event + the event we just recorded and both are execution counter 2.
289289 const rawRecordedEvents2 = ( await db [ "getAndValidatePingData" ] ( "aPing" ) )
290290 . sort ( ( a , b ) => {
291- const executionCounterA = parseInt ( a . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] || "0" ) ;
292- const executionCounterB = parseInt ( b . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] || "0" ) ;
291+ const executionCounterA = a . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] as number ;
292+ const executionCounterB = b . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] as number ;
293293 return executionCounterA - executionCounterB ;
294294 } ) ;
295295 assert . strictEqual ( rawRecordedEvents2 . length , 4 ) ;
296- assert . strictEqual ( rawRecordedEvents2 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
297- assert . strictEqual ( rawRecordedEvents2 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
298- assert . strictEqual ( rawRecordedEvents2 [ 2 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "2" ) ;
299- assert . strictEqual ( rawRecordedEvents2 [ 3 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "2" ) ;
296+ assert . strictEqual ( rawRecordedEvents2 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
297+ assert . strictEqual ( rawRecordedEvents2 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
298+ assert . strictEqual ( rawRecordedEvents2 [ 2 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 2 ) ;
299+ assert . strictEqual ( rawRecordedEvents2 [ 3 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 2 ) ;
300300
301301 ping . submit ( ) ;
302302 // Sanity check that the execution counter was cleared.
@@ -311,8 +311,8 @@ describe("EventsDatabase", function() {
311311 // We expect only two events again, the other have been cleared, execution counter 1.
312312 const rawRecordedEvents3 = ( await db [ "getAndValidatePingData" ] ( "aPing" ) ) ;
313313 assert . strictEqual ( rawRecordedEvents3 . length , 2 ) ;
314- assert . strictEqual ( rawRecordedEvents3 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
315- assert . strictEqual ( rawRecordedEvents3 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , "1" ) ;
314+ assert . strictEqual ( rawRecordedEvents3 [ 0 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
315+ assert . strictEqual ( rawRecordedEvents3 [ 1 ] . extra ?. [ GLEAN_EXECUTION_COUNTER_EXTRA_KEY ] , 1 ) ;
316316 } ) ;
317317
318318 it ( "reserved extra properties are removed from the recorded events" , async function ( ) {
0 commit comments