Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("over LongPolling it sends DELETE request and waits for poll to terminate", async (done) => {
// Create an HTTP client to capture the poll
const defaultClient = new DefaultHttpClient(TestLogger.instance);
class TestClient extends HttpClient {
public pollPromise: Promise | null;
constructor() {
super();
this.pollPromise = null;
}
public send(request: HttpRequest): Promise {
if (request.method === "GET") {
this.pollPromise = defaultClient.send(request);
return this.pollPromise;
}
return defaultClient.send(request);
}