request/request

socket hang up

mrhouzlane opened this issue · 0 comments

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