Integration testing of Forge Storage using JEST

Hi Colleagues,

I’m working on the backend part of the Forge Application and stick a little with the setup of integration tests of Forge Storage API. I’ve created a backend function to save the simple “key:value” data using Forge Storage API. Then I define this function in resolver in index.tsx file. The application manifest is in the right shape to use this function. Now, when I try to write the JEST test to invoke this function by bridge.invoke functionality, JEST shows me an error: “Test suite failed to run. The error below may be caused by using the wrong test environment”. Can you advise what JEST settings should be implemented to be able to run integration tests with real backend functions?

Using jest-environment-jsdom helps to fix the problem with the wrong test environment. Now I have another issue: Jest shows a more self-explaining error: “Unable to establish a connection with the Custom UI bridge. If you are trying to run your app locally, Forge apps only work in the context of Atlassian products”. Forge tunnel is running. Does it mean, that there is no possibility to run separate integration tests using real forge/resolver backend functions in JEST? For example, if I need to test only the part of backend functionality in close to a real development environment without mocking?