request / request

🏊🏾 Simplified HTTP request client.
Apache License 2.0
25.68k stars 3.15k forks source link

socket hang up #3430

Open mrhouzlane opened 1 year ago

mrhouzlane commented 1 year ago
test("#1 auth can get Access Token", async (done) => {
    const variables = { input: { clientId: CLIENT, grantType: "client_credentials", scope: "profile openid" } };
    const send = { query: authGql, variables: variables, operationName: "auth" };
    const auth = await request
      .post(path)
      .set("Authorization", "bearer " + jwtToken)
      .send(send)
      .expect(200)
      .then((res) => {
        assert.strictEqual(res.body.data.auth.success, true);
        assert.strictEqual(res.body.data.auth.message, "success");
        return res.body.data.auth;
      });

    accessToken = auth.accessToken;
    done(); 

When running this test I get socket hang up.

I tried auth.end(); but it didn't worked