@@ -51,7 +51,7 @@ describe('createTolerantCodec', () => {
5151 } ,
5252 } ) ;
5353 expect ( c . decode ( c . encode ( 42 ) ) ) . toBe ( 42 ) ;
54- // Invalid decode should return InvalidEntry, and encoding that should return the raw value
54+
5555 const invalid = c . decode ( 'x' ) ;
5656 expect ( invalid ) . toStrictEqual ( { __invalid : true , raw : 'x' } ) ;
5757 expect ( c . encode ( invalid ) ) . toBe ( 'x' ) ;
@@ -188,11 +188,9 @@ describe('WriteAheadLogFile', () => {
188188 const w = wal ( '/test/a.log' ) ;
189189 expect ( w . isClosed ( ) ) . toBe ( true ) ;
190190
191- // First open should open the file
192191 w . open ( ) ;
193192 expect ( w . isClosed ( ) ) . toBe ( false ) ;
194193
195- // Subsequent opens should be no-ops
196194 w . open ( ) ;
197195 expect ( w . isClosed ( ) ) . toBe ( false ) ;
198196 w . open ( ) ;
@@ -221,7 +219,6 @@ describe('WriteAheadLogFile', () => {
221219 } ) ;
222220
223221 it ( 'returns empty result when file does not exist' , ( ) => {
224- // File '/test/nonexistent.log' does not exist
225222 const w = wal ( '/test/nonexistent.log' ) ;
226223 const result = w . recover ( ) ;
227224
@@ -236,7 +233,7 @@ describe('WriteAheadLogFile', () => {
236233 vol . mkdirSync ( '/test' , { recursive : true } ) ;
237234 write ( '/test/a.log' , 'line1\nline2\n' ) ;
238235 const w = wal ( '/test/a.log' ) ;
239- // Profiler WAL can recover without opening - it reads the file directly
236+
240237 const result = w . recover ( ) ;
241238 expect ( result . records ) . toEqual ( [ 'line1' , 'line2' ] ) ;
242239 expect ( result . errors ) . toEqual ( [ ] ) ;
@@ -292,7 +289,6 @@ describe('WriteAheadLogFile', () => {
292289 } ,
293290 } ) ;
294291
295- // With tolerant codec, repack should succeed and preserve all entries (valid and invalid)
296292 wal ( '/test/a.log' , tolerantCodec ) . repack ( ) ;
297293 expect ( read ( '/test/a.log' ) ) . toBe ( 'ok\nbad\n' ) ;
298294 } ) ;
@@ -309,7 +305,6 @@ describe('WriteAheadLogFile', () => {
309305 const content = 'good\nbad\ngood\n' ;
310306 const result = recoverFromContent ( content , failingCodec . decode ) ;
311307
312- // Should have decode errors
313308 expect ( result . errors ) . toHaveLength ( 1 ) ;
314309 expect ( result . errors [ 0 ] . error . message ) . toBe ( 'Bad record during recovery' ) ;
315310 expect ( result . records ) . toEqual ( [ 'good' , 'good' ] ) ;
@@ -390,17 +385,14 @@ describe('stringCodec', () => {
390385 } ) ;
391386
392387 it ( 'should maintain type safety with generics' , ( ) => {
393- // Test with string type
394388 const stringCodecInstance = stringCodec < string > ( ) ;
395389 const str : string = stringCodecInstance . decode ( 'test' ) ;
396390 expect ( typeof str ) . toBe ( 'string' ) ;
397391
398- // Test with object type
399392 const objectCodecInstance = stringCodec < { id : number ; name : string } > ( ) ;
400393 const obj = objectCodecInstance . decode ( '{"id":1,"name":"test"}' ) ;
401394 expect ( obj ) . toEqual ( { id : 1 , name : 'test' } ) ;
402395
403- // Test with union type
404396 const unionCodecInstance = stringCodec < string | number [ ] > ( ) ;
405397 expect ( unionCodecInstance . decode ( 'string' ) ) . toBe ( 'string' ) ;
406398 expect ( unionCodecInstance . decode ( '[1,2,3]' ) ) . toEqual ( [ 1 , 2 , 3 ] ) ;
@@ -474,7 +466,6 @@ describe('getShardedGroupId', () => {
474466 const originalTimeOrigin = performance . timeOrigin ;
475467
476468 afterEach ( ( ) => {
477- // Restore original timeOrigin
478469 Object . defineProperty ( performance , 'timeOrigin' , {
479470 value : originalTimeOrigin ,
480471 writable : true ,
@@ -549,6 +540,6 @@ describe('getShardedGroupId', () => {
549540
550541 const result = getShardedGroupId ( ) ;
551542
552- expect ( result ) . toBe ( '-124' ) ; // Math.floor(-123.456) = -124
543+ expect ( result ) . toBe ( '-124' ) ;
553544 } ) ;
554545} ) ;
0 commit comments