@@ -246,15 +246,13 @@ import { Parser, fromFile } from "@asyncapi/parser";
246246const parser = new Parser ();
247247const asyncapi_websocket_query = path .resolve (__dirname , " ../../../helpers/test/__fixtures__/asyncapi-websocket-query.yml" );
248248const language = " javascript"
249- let parsedAsyncAPIDocument;
250249
251- async () => {
252- const parseResult = await fromFile (parser, asyncapi_websocket_query).parse ();
253- parsedAsyncAPIDocument = parseResult .document ;
254- }
250+ // Parse the AsyncAPI document (async operation)
251+ const parseResult = await fromFile (parser, asyncapi_websocket_query).parse ();
252+ const parsedAsyncAPIDocument = parseResult .document ;
255253
256254return (
257- < FileHeaderInfo info= {parsedAsyncAPIDocument .info ()} server= {parsedAsyncAPIDocument .servers ().get (" withPathname" )} language= {javascript } / >
255+ < FileHeaderInfo info= {parsedAsyncAPIDocument .info ()} server= {parsedAsyncAPIDocument .servers ().get (" withPathname" )} language= {language } / >
258256)
259257```
260258
@@ -291,16 +289,16 @@ Renders a WebSocket message handler method with optional pre- and post-execution
291289const language = " javascript"
292290const methodName = " handleMessage"
293291const methodParams = [" self" , " message" ]
294- const preExecutionCode = " # Pass the incoming message to all registered message handlers."
295- const postExecutionCode = " # Passed the incoming message to all registered message handlers."
292+ const preExecutionCode = " // Pass the incoming message to all registered message handlers."
293+ const postExecutionCode = " // Passed the incoming message to all registered message handlers."
296294const customMethodConfig = {
297295 javascript: {
298296 methodDocs: " // Method to handle message with callback" ,
299297 methodLogic: " if (cb) cb(message);"
300298 }
301299};
302300return (
303- < HandleMessage language= {language} methodName= {methodName} methodParams= {methodParams} preExecutionCode= {preExecutionCode} postExecutionCode = {postExecutionCode} customMethodConfig= {customMethodConfig} / >
301+ < HandleMessage language= {language} methodName= {methodName} methodParams= {methodParams} preExecutionCode= {preExecutionCode} postExecutionCode= {postExecutionCode} customMethodConfig= {customMethodConfig} / >
304302)
305303```
306304
@@ -385,10 +383,10 @@ import { Parser, fromFile } from "@asyncapi/parser";
385383
386384const parser = new Parser ();
387385const asyncapi_v3_path = path .resolve (__dirname , " ../__fixtures__/asyncapi-v3.yml" );
388- async () => {
389- const parseResult = await fromFile (parser, asyncapi_v3_path). parse ();
390- parsedAsyncAPIDocument = parseResult . document ;
391- }
386+
387+ // Parse the AsyncAPI document (async operation)
388+ const parseResult = await fromFile (parser, asyncapi_v3_path). parse () ;
389+ const parsedAsyncAPIDocument = parseResult . document ;
392390
393391const language = " java"
394392
@@ -543,12 +541,11 @@ import { Parser, fromFile } from "@asyncapi/parser";
543541
544542const parser = new Parser ();
545543const asyncapi_v3_path = path .resolve (__dirname , " ../__fixtures__/asyncapi-v3.yml" );
546- let parsedAsyncAPIDocument
544+ let parsedAsyncAPIDocument;
547545
548- async () => {
549- const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
550- parsedAsyncAPIDocument = parseResult .document ;
551- }
546+ // Parse the AsyncAPI document (async operation)
547+ const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
548+ const parsedAsyncAPIDocument = parseResult .document ;
552549
553550const channels = parsedAsyncAPIDocument .channels ();
554551const queryParamsObject = getQueryParams (channels);
@@ -672,12 +669,10 @@ import { Parser, fromFile } from "@asyncapi/parser";
672669
673670const parser = new Parser ();
674671const asyncapi_v3_path = path .resolve (__dirname , ' ../__fixtures__/asyncapi-v3.yml' );
675- let parsedAsyncAPIDocument;
676672
677- async () => {
678- const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
679- parsedAsyncAPIDocument = parseResult .document ;
680- }
673+ // Parse the AsyncAPI document (async operation)
674+ const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
675+ const parsedAsyncAPIDocument = parseResult .document ;
681676
682677const language = " javascript"
683678const clientName = " AccountServiceAPI"
0 commit comments