abhiisheek / babel-jest-amcharts

Babel Jest plugin to be used with amcharts
MIT License
2 stars 1 forks source link

TypeError: Cannot destructure property 'config' of 'undefined' as it is undefined. #1

Open AndrewLawendy opened 2 years ago

AndrewLawendy commented 2 years ago

Hello, thanks for the package I just have a little issue and no clue what to do if you can help me please

BTW I'm using testing-library not using create-react-app parcel.js as my bundler

{
  "presets": [
    "@babel/preset-react",
    "@babel/preset-env",
    "@babel/preset-typescript"
  ]
}
"jest": {
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.ts"
    },
    "transform": {
      "^.+\\.(js|jsx)$": "babel-jest-amcharts",
      "^.+\\.(ts|tsx)$": "babel-jest"
    },
    "transformIgnorePatterns": [
      "[/\\\\]node_modules[/\\\\](?!(@amcharts)\\/).+\\.(js|jsx|ts|tsx)$"
    ]
  },
src/tests/Dashboard.spec.tsx
  ● Test suite failed to run

    TypeError: Cannot destructure property 'config' of 'undefined' as it is undefined.

      at Object.getCacheKey (node_modules/babel-jest-amcharts/node_modules/babel-jest/build/index.js:151:8)
      at ScriptTransformer._getCacheKey (node_modules/@jest/transform/build/ScriptTransformer.js:280:41)
      at ScriptTransformer._getFileCachePath (node_modules/@jest/transform/build/ScriptTransformer.js:351:27)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:588:32)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:758:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:815:19)
oleh-lypyn commented 1 year ago

@AndrewLawendy was you able to solve this issue?