@@ -221,10 +221,11 @@ describe("mcp_cli_bridge.cjs", () => {
221221 showHelp ( "safeoutputs" , tools ) ;
222222
223223 const outputLines = stdoutChunks . join ( "" ) . trimEnd ( ) . split ( "\n" ) ;
224+ const output = outputLines . join ( "\n" ) ;
224225 expect ( outputLines . length ) . toBeLessThanOrEqual ( 20 ) ;
225- expect ( outputLines . join ( "\n" ) ) . not . toMatch ( / \. \. \. \+ \d + m o r e c o m m a n d \( s \) / ) ;
226+ expect ( output ) . not . toMatch ( / \. \. \. \+ \d + m o r e c o m m a n d \( s \) / ) ;
226227 for ( const tool of tools ) {
227- expect ( outputLines . join ( "\n" ) ) . toContain ( tool . name ) ;
228+ expect ( output ) . toContain ( tool . name ) ;
228229 }
229230 } ) ;
230231
@@ -237,10 +238,11 @@ describe("mcp_cli_bridge.cjs", () => {
237238 showHelp ( "safeoutputs" , tools ) ;
238239
239240 const outputLines = stdoutChunks . join ( "" ) . trimEnd ( ) . split ( "\n" ) ;
241+ const output = outputLines . join ( "\n" ) ;
240242 expect ( outputLines . length ) . toBeLessThanOrEqual ( 20 ) ;
241- expect ( outputLines . join ( "\n" ) ) . not . toMatch ( / \. \. \. \+ \d + m o r e c o m m a n d \( s \) / ) ;
243+ expect ( output ) . not . toMatch ( / \. \. \. \+ \d + m o r e c o m m a n d \( s \) / ) ;
242244 for ( const tool of tools ) {
243- expect ( outputLines . join ( "\n" ) ) . toContain ( tool . name ) ;
245+ expect ( output ) . toContain ( tool . name ) ;
244246 }
245247 } ) ;
246248
@@ -262,14 +264,15 @@ describe("mcp_cli_bridge.cjs", () => {
262264 ] ) ;
263265
264266 const outputLines = stdoutChunks . join ( "" ) . trimEnd ( ) . split ( "\n" ) ;
267+ const output = outputLines . join ( "\n" ) ;
265268 expect ( outputLines . length ) . toBeLessThanOrEqual ( 30 ) ;
266- expect ( outputLines . join ( "\n" ) ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
267- expect ( outputLines . join ( "\n" ) ) . toContain ( "Required options are marked with *." ) ;
269+ expect ( output ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
270+ expect ( output ) . toContain ( "Required options are marked with *." ) ;
268271 for ( let i = 1 ; i <= 24 ; i ++ ) {
269- expect ( outputLines . join ( "\n" ) ) . toContain ( `--field_${ i } ` ) ;
272+ expect ( output ) . toContain ( `--field_${ i } ` ) ;
270273 }
271- expect ( outputLines . join ( "\n" ) ) . toContain ( "--field_1*" ) ;
272- expect ( outputLines . join ( "\n" ) ) . toContain ( "--field_2*" ) ;
274+ expect ( output ) . toContain ( "--field_1*" ) ;
275+ expect ( output ) . toContain ( "--field_2*" ) ;
273276 } ) ;
274277
275278 it ( "does not truncate command help when options exactly fit the line budget" , ( ) => {
@@ -290,15 +293,16 @@ describe("mcp_cli_bridge.cjs", () => {
290293 ] ) ;
291294
292295 const outputLines = stdoutChunks . join ( "" ) . trimEnd ( ) . split ( "\n" ) ;
296+ const output = outputLines . join ( "\n" ) ;
293297 expect ( outputLines . length ) . toBeLessThanOrEqual ( 30 ) ;
294- expect ( outputLines . join ( "\n" ) ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
295- expect ( outputLines . join ( "\n" ) ) . toContain ( "Required options are marked with *." ) ;
298+ expect ( output ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
299+ expect ( output ) . toContain ( "Required options are marked with *." ) ;
296300 for ( let i = 1 ; i <= 13 ; i ++ ) {
297- expect ( outputLines . join ( "\n" ) ) . toContain ( `--field_${ i } ` ) ;
301+ expect ( output ) . toContain ( `--field_${ i } ` ) ;
298302 }
299303 } ) ;
300304
301- it ( "keeps required- note when required options are in the compact list" , ( ) => {
305+ it ( "keeps required note when required options are in the compact list" , ( ) => {
302306 const properties = { } ;
303307 for ( let i = 1 ; i <= 24 ; i ++ ) {
304308 properties [ `field_${ i } ` ] = { type : "string" , description : `Field ${ i } .` } ;
@@ -316,10 +320,11 @@ describe("mcp_cli_bridge.cjs", () => {
316320 ] ) ;
317321
318322 const outputLines = stdoutChunks . join ( "" ) . trimEnd ( ) . split ( "\n" ) ;
319- expect ( outputLines . join ( "\n" ) ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
320- expect ( outputLines . join ( "\n" ) ) . toContain ( "Required options are marked with *." ) ;
321- expect ( outputLines . join ( "\n" ) ) . toContain ( "--field_23*" ) ;
322- expect ( outputLines . join ( "\n" ) ) . toContain ( "--field_24*" ) ;
323+ const output = outputLines . join ( "\n" ) ;
324+ expect ( output ) . not . toMatch ( / \. \. \. \+ \d + m o r e o p t i o n \( s \) / ) ;
325+ expect ( output ) . toContain ( "Required options are marked with *." ) ;
326+ expect ( output ) . toContain ( "--field_23*" ) ;
327+ expect ( output ) . toContain ( "--field_24*" ) ;
323328 } ) ;
324329
325330 describe ( "stdin placeholder removed — '-' is always a literal value" , ( ) => {
0 commit comments