Jest test case do not run from inside our CI pipeline

We are trying to run jest within the CI pipeline to build Jupyterlab (v.2.2.9) from source. (We are making custom enhancements that hopefully we can contribute back to the community).

We are running the following commands from our CI pipeline. (Note: our CI pipeline is an enterprise resource and but is very locked down. Our CI pipeline blocks TCP connections to other services (e.g., databases, web servers, etc).

jlpm run build:testutils &&
jlpm test

Jest fails when it tries to execute the test cases in @jupyterlab/services. Seems the test case it is trying to connect to a web server running at http://localhost/lab/api/workspaces/foo?1623284333692. That URL does not exist in our CI pipeline. Here is the exact error.

19:19:09 @jupyterlab/services: ● workspace › WorkspaceManager › #fetch() › should fetch a saved workspace
19:19:09 @jupyterlab/services: TypeError: request to http://localhost/lab/api/workspaces/foo?1623284333692 failed, reason: connect ECONNREFUSED 127.0.0.1:80FetchError: request to http://localhost/lab/api/workspaces/foo?1623284333692 failed, reason: connect ECONNREFUSED 127.0.0.1:80

What do we need to do to get this test case to run successfully? Are we forgetting to include required dependencies in order to make Jest run all of the test cases successfully?

Please advise how to work around this issue.

Finally,