title: Mock actions after creating service in moleculer microservice Nodejs
body: <p>I want to test an action. Inside that service action, I am calling another service action.
  code looks like below</p>
  <pre><code>describe(&quot;Test auth service&quot;, () =&gt; {
      describe(&quot;action&quot;, ()=&gt;{
          let broker = new ServiceBroker({
              logger: false,
          });
  
          let authService = broker.createService(TestAuthService);
          let storageService = broker.createService(TestStorageService);
  
          beforeAll(() =&gt; broker.start());
          afterAll(() =&gt; broker.stop());
  
          for (
              let i = 0;
              i &lt; params.length;
              i++
          ) {
              const {
                  testName,
                  input,
                  expectedResponse,
              } = params[i];
  
              describe(&quot;unit test&quot;, () =&gt; {
                  afterAll(() =&gt; {
                      //Tear down
                  });
                  storageService.actions.uploadPhotoToStorage = jest.fn(()=&gt; Prmoise.resolve(&quot;Uploaded&quot;))
                  test(testName, async () =&gt; {
                      const userData = await dummyUserSignup(apiService, authService);
                      const uploadVideoResponse = await broker.call(&quot;auth.uploadPhoto&quot;, {...input, user: userData});
                      //assert
                  });
              });
          }
      })
  });
  
  </code></pre>
  <p>There is a <code>uploadPhoto</code> action present in <code>auth</code> service. From <code>uploadPhoto</code> action I am calling <code>uploadPhotoToStorage</code> in storage service.
  I wanted to mock the <code>uploadPhotoToStorage</code> in storage service.</p>
  <p>Is there any way I can mock action after creating the service.</p>