@@ -262,7 +262,6 @@ describe('processStrReplace', () => {
262262 expect ( result ) . not . toBeNull ( )
263263 expect ( 'content' in result ) . toBe ( true )
264264 if ( 'content' in result ) {
265-
266265 expect ( result . content ) . toBe ( 'FOO bar FOO baz FOO' )
267266 }
268267 } )
@@ -305,8 +304,9 @@ describe('processStrReplace', () => {
305304 // Should have applied foo->FOO and qux qux->QUX, but not baz->BAZ
306305
307306 expect ( result . content ) . toBe ( 'FOO bar FOO\nbaz baz baz\nQUX' )
308- expect ( result . messages ) . toContain ( 'Found 3 occurrences of "baz"' )
309- expect ( result . messages ) . toContain ( 'set allowMultiple to true' )
307+ expect ( result . messages ) . toHaveLength ( 1 )
308+ expect ( result . messages [ 0 ] ) . toContain ( 'Found 3 occurrences of "baz"' )
309+ expect ( result . messages [ 0 ] ) . toContain ( 'set allowMultiple to true' )
310310 }
311311 } )
312312
@@ -321,7 +321,7 @@ function test3() {
321321 console.log('info');
322322}`
323323 const oldStr = "console.log('debug');"
324- const newStr = " // removed debug log"
324+ const newStr = ' // removed debug log'
325325
326326 const result = await processStrReplace (
327327 'test.ts' ,
@@ -334,7 +334,9 @@ function test3() {
334334 if ( 'content' in result ) {
335335 expect ( result . content ) . toContain ( '// removed debug log' )
336336 // Should have replaced both debug logs but not the info log
337- expect ( ( result . content . match ( / r e m o v e d d e b u g l o g / g) || [ ] ) . length ) . toBe ( 2 )
337+ expect ( ( result . content . match ( / r e m o v e d d e b u g l o g / g) || [ ] ) . length ) . toBe (
338+ 2 ,
339+ )
338340 expect ( result . content ) . toContain ( "console.log('info');" )
339341 }
340342 } )
0 commit comments