11import { ServiceBroker } from "moleculer" ;
22import { vi , describe , it , expect , beforeAll , afterAll , beforeEach } from "vitest" ;
33import { execa } from "execa" ;
4- import path from "node:path" ;
54
6- const binPath = path . resolve ( __dirname , "../../../ bin/moleculer.js") ;
5+ const binPath = "./ bin/moleculer.js";
76
87describe . skip ( "E2E: call command" , ( ) => {
98 const transporter = "NATS" ;
@@ -38,8 +37,8 @@ describe.skip("E2E: call command", () => {
3837 } ) ;
3938
4039 it ( "should emit an event" , async ( ) => {
41- const cmd = `node ${ binPath } emit --ns ${ ns } -t ${ transporter } test.event --@name=John` ;
42- const { stdout , stderr , exitCode } = await execa ( cmd ) ;
40+ const { stdout , stderr , exitCode } =
41+ await execa `node ${ binPath } emit --ns ${ ns } -t ${ transporter } test.event --@name=John` ;
4342 expect ( exitCode ) . toBe ( 0 ) ;
4443 expect ( stdout ) . toBe ( "OK" ) ;
4544 expect ( stderr ) . toBe ( "" ) ;
@@ -58,8 +57,8 @@ describe.skip("E2E: call command", () => {
5857 } ) ;
5958
6059 it ( "should broadcast an event" , async ( ) => {
61- const cmd = `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast test.event --@name=Jane` ;
62- const { stdout , stderr , exitCode } = await execa ( cmd ) ;
60+ const { stdout , stderr , exitCode } =
61+ await execa `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast test.event --@name=Jane` ;
6362 expect ( exitCode ) . toBe ( 0 ) ;
6463 expect ( stdout ) . toBe ( "OK" ) ;
6564 expect ( stderr ) . toBe ( "" ) ;
@@ -77,8 +76,8 @@ describe.skip("E2E: call command", () => {
7776 } ) ;
7877
7978 it ( "should broadcast an event with group but not called the greeter handler" , async ( ) => {
80- const cmd = `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast --group asd test.event --@name=Jane` ;
81- const { stdout , stderr , exitCode } = await execa ( cmd ) ;
79+ const { stdout , stderr , exitCode } =
80+ await execa `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast --group asd test.event --@name=Jane` ;
8281 expect ( exitCode ) . toBe ( 0 ) ;
8382 expect ( stdout ) . toBe ( "OK" ) ;
8483 expect ( stderr ) . toBe ( "" ) ;
@@ -87,8 +86,8 @@ describe.skip("E2E: call command", () => {
8786 } ) ;
8887
8988 it ( "should broadcast an event with group and called the greeter handler" , async ( ) => {
90- const cmd = `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast --group greeter test.event --@name=Jane` ;
91- const { stdout , stderr , exitCode } = await execa ( cmd ) ;
89+ const { stdout , stderr , exitCode } =
90+ await execa `node ${ binPath } emit --ns ${ ns } -t ${ transporter } --broadcast --group greeter test.event --@name=Jane` ;
9291 expect ( exitCode ) . toBe ( 0 ) ;
9392 expect ( stdout ) . toBe ( "OK" ) ;
9493 expect ( stderr ) . toBe ( "" ) ;
0 commit comments