sh33dafi / jest-sonar

A jest reporter that generates sonar reports
MIT License
49 stars 11 forks source link

Reporter fails with Jest v27 and new default runner jest-circuit #38

Closed Neumann-Nils closed 1 year ago

Neumann-Nils commented 3 years ago

Describe the bug When running tests with Jest v27, a new runner called jest-circuit (see https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults) is used. When using the jest-sonar reporter, the execution fails (see error ouput below).

After some investigation, we found out that switching the runner back to jest-jasmine2, the error goes away and the reporter runs smoothly. However, as jest-runner is the new default, we want to change it in the future.

Unluckily, we cannot provide any further insights yet nor any input on fixing the error. If you need more information, let us know!

To Reproduce Steps to reproduce the behavior:

  1. Update your Jest version to v27 and don't change the default runner
  2. Run your tests with jest-sonar as a reporter (e.g. jest --ci --reporters=jest-sonar)
  3. See error:
    > jest --ci --reporters=jest-sonar
    /usr/local/bin/node[468]: ../src/node_contextify.cc:1035:static void node::contextify::ContextifyContext::CompileFunction(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[0]->IsString()' failed.
    1: 0xa222f0 node::Abort() [/usr/local/bin/node]
    2: 0xa2236e  [/usr/local/bin/node]
    3: 0xa1515a node::contextify::ContextifyContext::CompileFunction(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
    4: 0x13bcf6d  [/usr/local/bin/node]

Expected behavior When running jest-sonar with Jest v27 and the new default jest-circuit runner, the behavior should not change and the reporter should run succesfully.

Desktop (please complete the following information):

Additional context With Jest v26 (and jasmine as the default runner), the reporter works just fine locally and in Jenkins.

sh33dafi commented 1 year ago

Can you provide a sample repo to test this out I'm not able to reproduce this (I used this repo)

Neumann-Nils commented 1 year ago

@sh33dafi Thanks for your response. Unluckily, I am unable to reproduce the error anymore. From my side, feel free to close this issue.

sh33dafi commented 1 year ago

Feel free to create a new issue if you can reproduce it

github-actions[bot] commented 1 year ago

Locked due to an inactive of 90 days