Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
I want to know how can bypass dependencies when running unit tests of service actions. Is there any parameter options when creating new instance of ServiceBroker
Also another thing how can I initialise ctx.meta.someProperty in my tests as my action depends on it. This property is set from the api service in onBeforeCall
Expected Behavior
I should be able to run unit tests
Failure Information
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
I want to write unit tests for login action in auth service.
Here is the code for auth service
https://gist.github.com/goldytech/ccbd0a149ae40d29ec2638a353402013
The auth service has a dependency on greeter service. In greeter service I'm initialising my db in
created
life cycle event of the service.Here is the code for greeter service
https://gist.github.com/goldytech/1ca35374f497d738621ca17e7e5e7fc5
This is the code for my unit test for login action in auth service
https://gist.github.com/goldytech/68dd303977b47da841c830d8171362d3
This above code gives me error
Error: Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.
I want to know how can bypass dependencies when running unit tests of service actions. Is there any parameter options when creating new instance of
ServiceBroker
Also another thing how can I initialise ctx.meta.someProperty in my tests as my action depends on it. This property is set from the api service in
onBeforeCall
Expected Behavior
I should be able to run unit tests
Failure Information
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Reproduce code snippet
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs