reportportal / agent-js-jest

Agent to integrate Jest with ReportPortal.
https://www.npmjs.com/package/@reportportal/agent-js-jest
Apache License 2.0
21 stars 36 forks source link

Cannot connect to ReportPortal #107

Closed Gittrotter closed 2 years ago

Gittrotter commented 2 years ago

I have followed the guide to configure reportportal/agent-js-jest, but when I run the tests, I get an error:

Error: connect ECONNREFUSED ::1:80
    at /*******/node_modules/@reportportal/client-javascript/lib/rest.js:37:15
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

I have added print out to the console to see the values and this is what I get:

****url: //launch

****method: POST

****data: {"name":"Unit Tests","startTime":1652228835444,"launch":"Unit Tests",
"attributes":[{"key":"agent","value":"@reportportal/agent-js-jest|5.0.3","system":true}
{"key":"client","value":"@reportportal/client-javascript|5.0.6","system":true},
{"key":"os","value":"Darwin|x64","system":true},{"key":"RAMSize","value":17179869184,"system":true},
{"key":"nodeJS","value":"v18.0.0","system":true}]}

****options: {"headers":{"User-Agent":"NodeJS","Authorization":"bearer undefined"}}

Here's my jest.config.js configuration:

reporters: [
    ['@reportportal/agent-js-jest',
    {
      token: '****************************',
      endpoint: 'http://myinstance:8080/api/v1',
      project: 'jest',
      launch: 'Jest Tests',
      description: '',
      skippedIssue: false,
      debug: true,
      restClientConfig: {
        timeout: 5000,
      },
    }],
  ],

I'm not sure where the url is coming from, but clearly it's not coming from the jest.config file. Any suggestions?

Gittrotter commented 2 years ago

Never mind. It was a configuration issue in package.json