Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'cwd') #520

Open
derweise opened this issue Dec 14, 2022 · 0 comments
Open

TypeError: Cannot read properties of undefined (reading 'cwd') #520

derweise opened this issue Dec 14, 2022 · 0 comments

Comments

@derweise
Copy link

derweise commented Dec 14, 2022

When running:

npm run test:unit --coverage && npm run test:e2e

But I am getting:

 Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'cwd')

      at Object.getCacheKey (node_modules/babel-jest/build/index.js:301:33)

package.json:

"vue": "^3.2.33",

and:

"devDependencies": {
    "@types/jest": "28.1.1",
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-e2e-nightwatch": "^4.5.11",
    "@vue/cli-plugin-eslint": "~4.5.15",
    "@vue/cli-plugin-unit-jest": "~4.5.19",
     ....
    "@vue/test-utils": "2.0.2",
    "@vue/vue3-jest": "^28.1.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^28.1.3",
     .....
    "jest": "^28.1.3",
     ...
  },

and:

"jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "vue"
    ],
    "transform": {
      "^.+\\.vue$": "@vue/vue3-jest",
      ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
      "^.+\\.js$": "<rootDir>/node_modules/babel-jest"
    },
    "transformIgnorePatterns": [
      "/node_modules/"
    ],
    "moduleNameMapper": {
      "^@/(.*)$": "<rootDir>/src/$1"
    },
    "snapshotSerializers": [
      "jest-serializer-vue"
    ],
    "testMatch": [
      "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
    ],
    "testURL": "http://localhost/",
    "watchPlugins": [
      "jest-watch-typeahead/filename",
      "jest-watch-typeahead/testname"
    ],
    "collectCoverageFrom": [
      "src/**/*.{js,vue}",
      "!node_modules/*",
      "!src/main.js",
      "!src/router.js",
      "!src/store/index.js",
      "!src/setup/*"
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant