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
Details:
Users/.bpmnlintrc:2
   "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?

Thanks

1 Like

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.

Hello, I still have the same issue running the test
Anybody suggest

1 Like

Hey Team , I am also facing the same exact issue . Can someone please suggest the solution.
I do not want to pack .bpmnlintrc file into js file via bpmnlint-pack-config