@@ -248,13 +248,12 @@ const asyncapi_websocket_query = path.resolve(__dirname, "../../../helpers/test/
248248const language = " javascript"
249249let parsedAsyncAPIDocument;
250250
251- async () => {
252- const parseResult = await fromFile (parser, asyncapi_websocket_query).parse ();
253- parsedAsyncAPIDocument = parseResult .document ;
254- }
251+ // Parse the AsyncAPI document (async operation)
252+ const parseResult = await fromFile (parser, asyncapi_websocket_query).parse ();
253+ const parsedAsyncAPIDocument = parseResult .document ;
255254
256255return (
257- < FileHeaderInfo info= {parsedAsyncAPIDocument .info ()} server= {parsedAsyncAPIDocument .servers ().get (" withPathname" )} language= {javascript } / >
256+ < FileHeaderInfo info= {parsedAsyncAPIDocument .info ()} server= {parsedAsyncAPIDocument .servers ().get (" withPathname" )} language= {language } / >
258257)
259258```
260259
@@ -291,16 +290,16 @@ Renders a WebSocket message handler method with optional pre- and post-execution
291290const language = " javascript"
292291const methodName = " handleMessage"
293292const 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."
293+ const preExecutionCode = " // Pass the incoming message to all registered message handlers."
294+ const postExecutionCode = " // Passed the incoming message to all registered message handlers."
296295const customMethodConfig = {
297296 javascript: {
298297 methodDocs: " // Method to handle message with callback" ,
299298 methodLogic: " if (cb) cb(message);"
300299 }
301300};
302301return (
303- < HandleMessage language= {language} methodName= {methodName} methodParams= {methodParams} preExecutionCode= {preExecutionCode} postExecutionCode = {postExecutionCode} customMethodConfig= {customMethodConfig} / >
302+ < HandleMessage language= {language} methodName= {methodName} methodParams= {methodParams} preExecutionCode= {preExecutionCode} postExecutionCode= {postExecutionCode} customMethodConfig= {customMethodConfig} / >
304303)
305304```
306305
@@ -385,10 +384,10 @@ import { Parser, fromFile } from "@asyncapi/parser";
385384
386385const parser = new Parser ();
387386const 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- }
387+
388+ // Parse the AsyncAPI document (async operation)
389+ const parseResult = await fromFile (parser, asyncapi_v3_path). parse () ;
390+ parsedAsyncAPIDocument = parseResult . document ;
392391
393392const language = " java"
394393
@@ -543,12 +542,11 @@ import { Parser, fromFile } from "@asyncapi/parser";
543542
544543const parser = new Parser ();
545544const asyncapi_v3_path = path .resolve (__dirname , " ../__fixtures__/asyncapi-v3.yml" );
546- let parsedAsyncAPIDocument
545+ let parsedAsyncAPIDocument;
547546
548- async () => {
549- const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
550- parsedAsyncAPIDocument = parseResult .document ;
551- }
547+ // Parse the AsyncAPI document (async operation)
548+ const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
549+ parsedAsyncAPIDocument = parseResult .document ;
552550
553551const channels = parsedAsyncAPIDocument .channels ();
554552const queryParamsObject = getQueryParams (channels);
@@ -674,10 +672,11 @@ const parser = new Parser();
674672const asyncapi_v3_path = path .resolve (__dirname , ' ../__fixtures__/asyncapi-v3.yml' );
675673let parsedAsyncAPIDocument;
676674
677- async () => {
675+ // Parse the AsyncAPI document (async operation)
676+ (async () => {
678677 const parseResult = await fromFile (parser, asyncapi_v3_path).parse ();
679678 parsedAsyncAPIDocument = parseResult .document ;
680- }
679+ })();
681680
682681const language = " javascript"
683682const clientName = " AccountServiceAPI"
0 commit comments