geonetwork-ui icon indicating copy to clipboard operation
geonetwork-ui copied to clipboard

No stack trace on unit tests failure with node 21.0 and above

Open jahow opened this issue 10 months ago • 0 comments

Describe the bug

When a failure happens within a unit test (run with jest), no stack trace is present.

  • GeoNetwork-UI version used: main
  • node version 21.0 and above

To reproduce:

  • install node v21 (.g. with nvm)
  • Create a test like so:
    it('will fail', () => {
      throw new Error('blargz')
    })
    
  • Set the test configuration in the IDE to use node 21
  • Run the test in the IDE

Received: image

Expected (obtained with node 20.10): image

Potential solution

@rcaplier managed to fix the issue by using the jest-jasmine2 test runner. This looks like it was intended to ease the migration from jasmine to jest so I'm not 100% sure this is the right way to go.

jahow avatar Apr 23 '24 14:04 jahow