Jest encountered an unexpected token

Hi, I am using bpmnlint-loader to load the .bpmnlintc file, and its working fine.

import bpmnlintConfig from '../../../../../.bpmnlintrc';

However when I execute unit test using Jest, the following errors appear:

Jest encountered an unexpected token
   "extends": [
SyntaxError: Unexpected token ':'

So I tried to put this into jest.config.js in order to have the bpmnlint-loader library included:

transformIgnorePatterns: ["../../node_modules/(?!bpmnlint-loader|bpmnlint|bpmn-js-bpmnlint)"],

But its still not working. Any idea why and how to solve it?


Hi @Zhen_Jing_Heng, welcome!

Can you maybe share your setup with us? This way it will be easier for us to help you.

Not 100% sure how Jest handles these files that are supposed to be transformed. In this case the .bpmnlintrc file is converted to a JavaScript equivalent file. Does Jest run in NodeJS?

As an alternative, I am currently using bpmnlint-pack-config in my devDepedencis in package.json to pack the .bpmnlintrc file into js file, which is then imported to be used elsewhere.