Hi all,
I wanted to share an update regarding the enhancement of our O3 integration tests. Recently, we have discovered that we can improve the O3 integration tests by utilizing MockServiceWorker (MSW), a tool specifically designed for mocking API calls. Currently, I am in the process of configuring MockServiceWorker on the esm-admin-tools repository.
When we execute tests with MockServiceWorker, it intercepts the API calls specified in the handlers and replaces them with the predefined responses. Following the MSW documentation, I have configured it on the esm-admin-tools repository by implementing a sample handler through this pull request. For debugging purposes, I have enabled the option to list all unhandled request intercepts.
Unfortunately, I have encountered a problem with the implementation: it appears that none of the API requests are being intercepted.
I also had a discussion regarding this with @dkigen on the last dev standup call and the problem might be related to the openmrsFetch
function. I’ll be further looking into fixing this issue. Any guidance or suggestions would be greatly appreciated. Thank you.