Closed trevor-vaughan closed 10 months ago
The only time it reaches out to a gitlab server is when there is a request, so would a request timeout work here?
Well, I took a good solid try at it using jest-fetch-mock
without any luck (it mocked but didn't actually work for some reason).
I think I'm going to have to use MSW and give some actual responses to fully test the workflow.
Any chance you could share the code youre working on? Might help seeing the exact context youre working with.
Unfortunately no. The gist of it is that I'm using jest
to fire up the full entry point of a CLI tool in order to do full acceptance testing.
Similar to what i do In the CLI tests of the library?
Is there anyway for you to abstract out a sample project that has the same issue?
Ah yes, very similar to that test!
I'm not quite following how you're mocking out the server connection though.
In that particular test, im not. Its a full e2e test. Here, i mock the whole rest package though.
Description
I'm currently wrapping my CLI tool using gitbeaker in Jest tests and, while this works, there are dangling file descriptors related to attempting to contact gitlab servers that do not exist remaining after execution.
This seems to be causing Jest to kill unrelated tests at random intervals.
While I could possibly mock out all remote connections, that's a heck of a lot of effort.
So is there:
Checklist