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

Getting 400 error #82

Closed JustinChetty closed 2 years ago

JustinChetty commented 3 years ago

Getting below error when using package wit jest

Error: Request failed with status code 400: {"errorCode":4001,"message":"Incorrect Request. [Field 'name' should not be null.] "} at C:\Sanlam Projects\Automation\node_modules\@reportportal\client-javascript\lib\rest.js:36:23

AmsterGet commented 3 years ago

Hello @JustinChetty ! At what stage did you get this error? It seems that the agent did not provide some data to the client (name) and this resulted in an error.

alexandre-lim commented 2 years ago

Hello @JustinChetty, I had the same error and it's probably because a test file is missing describe() 🤔 It's possible to reproduce the bug using this example:

const addition = (a, b) => a + b;

describe('addition', () => {
  it('should return 5', () => {
    const result = addition(2, 3);
    expect(result).toBe(5);
  });
});

it('addition should return 5', () => {
  const result = addition(2, 3);
  expect(result).toBe(5);
});

The test without describe wrapping causes the bug.

renkyoji commented 2 years ago

The task has been created. Will be fixed in next version.