TypeError: myJson.getTestExecutions.results.at is not a function

Viewed 15

Trying to run this code in a Jenkins in a Linux machine returns me the error Error performing query: TypeError: data.getTestExecutions.results.at is not a function but in Visual Studio works properly

var authenticate_url = xray_cloud_base_url + "/authenticate";

axios.post(authenticate_url, { "client_id": client_id, "client_secret": client_secret }, {}).then((response) => {
  console.log('success');
  var auth_token = response.data;
  console.log("AUTH: " + auth_token);
  const graphQLClient = new GraphQLClient(xray_cloud_graphql_url, {
    headers: {
      authorization: `Bearer ${auth_token}`,
    },
  })
  const detailed_query = gql`{
      getTestExecutions(limit: 100) {
          total
          start
          limit
          results {
            issueId
            jira(fields: ["key"])
          }
    }
}
`
  graphQLClient.request(detailed_query).then(function (data) {
    console.log(JSON.stringify(data, undefined, 2));
    testexecution_key = String(data.getTestExecutions.results.at(0).jira.key);
  }).catch(function (error) {
    console.log('Error performing query: ' + error);
  });
}).catch((error) => {
  console.log('Error on Authentication: ' + error);
});





 
1 Answers

The Node.js version was not updated that generated problems with the method at() updating Node.js in the Jenkins machine solve it

Related