Jest unable to parse .bpmn extension file

Hi ,

I am using Jest ( v28 ) with webpack ( v4.46 ) to write test case via React ( v16 )
A React component is using the .bpmn extension file to preload the editor .
While writing the test case for it , JEST framework is not able to read the .bpmn file
and giving following error

({“Object.”:function(module,exports,require,__dirname,__filename,jest){<?xml version="1.0" encoding="UTF-8"?>

SyntaxError: Unexpected token ‘<’

I used the following jest config to make the JEST understand the .bpmn extension

transform: {
‘^.+\.bpmn?$’: ‘jest-raw-loader’,
‘^.+\.(ts|tsx)?$’: ‘ts-jest’,
‘^.+\.(js|jsx)?$’: ‘babel-jest’,
},

I used jest-raw-loader to resolve the above error but it is not working. Requesting the team to please help .
cc: @nikku

In our examples, we use the raw-loader for this. It seems like the Jest wrapper has some compatibility issues; maybe you find help with this issue.

Thank you for the immediate response @Niklas_Kiefer
I found the solution . I had somehow added the path of the bpmn file in the transformIgnorePatterns property of jest.config.js

After removing that it worked.
Thank you .

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.