jest-watch-typeahead icon indicating copy to clipboard operation
jest-watch-typeahead copied to clipboard

Type Error: Cannot find 'replace' of undefined - Test Name Only

Open stephencweiss opened this issue 4 years ago • 4 comments
trafficstars

Hi! Really happy I found this package, so thank you for all the work you've already done!

I was trying to walk through configuring it and testing it with a project I have and the filter by filename worked like a charm. However, when I got to trying the testname, things started blowing up.

https://user-images.githubusercontent.com/39878535/105194713-7caffa00-5aff-11eb-89e3-8ee2102251ea.mov

Config:

const path = require('path')

module.exports = {
  rootDir: path.join(__dirname, '..'),
  moduleDirectories: [
    'node_modules',
    path.join(__dirname, '../src'),
    'shared',
    path.join(__dirname),
  ],
  moduleNameMapper: {
    '\\.module\\.css$': 'identity-obj-proxy',
    '\\.css$': require.resolve('./style-mock.js'),
  },
  watchPlugins: ['jest-watch-select-projects','jest-watch-typeahead/filename','jest-watch-typeahead/testname'],
}

Package.json:

"devDependencies": {
    "@babel/core": "^7.7.4",
    "@babel/plugin-transform-runtime": "^7.7.4",
    "@babel/preset-env": "^7.7.4",
    "@babel/preset-react": "^7.7.4",
    "@babel/runtime": "^7.7.4",
    "@emotion/babel-preset-css-prop": "^10.0.23",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "babel-loader": "^8.0.6",
    "css-loader": "^3.2.0",
    "eslint": "^6.7.1",
    "eslint-config-cypress": "^0.28.0",
    "eslint-config-kentcdodds": "^14.6.1",
    "eslint-import-resolver-jest": "^3.0.0",
    "file-loader": "^5.0.2",
    "husky": "^3.1.0",
    "identity-obj-proxy": "^3.0.0",
    "is-ci-cli": "^2.0.0",
    "jest": "^26.6.3",
    "jest-emotion": "^10.0.17",
    "jest-runner-eslint": "^0.7.5",
    "jest-watch-select-projects": "^1.0.0",
    "jest-watch-typeahead": "^0.4.2",
    "lint-staged": "^9.4.3",
    "prettier": "^1.19.1",
    "prop-types": "^15.7.2",
    "serve": "^11.2.0",
    "style-loader": "^1.0.0",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10",
    "webpack-dev-server": "^3.9.0"
  },
  "dependencies": {
    "@emotion/core": "^10.0.22",
    "@emotion/styled": "^10.0.23",
    "emotion-theming": "^10.0.19",
    "react": "^16.12.0",
    "react-dom": "^16.12.0"
  },

Any suggestions are welcome. Thanks!

stephencweiss avatar Jan 20 '21 15:01 stephencweiss

Sorry, missed this issue. Would you be able to put together a minimal reproduction for this?

SimenB avatar May 10 '21 20:05 SimenB

Will try -- this was a little while ago, so will need to revisit.

stephencweiss avatar May 11 '21 12:05 stephencweiss

I can reproduce this issue when having a project with runner: 'jest-runner-eslint'. As soon as I remove that project, the test name filter works again.

andre-brdoch avatar May 04 '22 11:05 andre-brdoch

Please put together a minimal reproduction

SimenB avatar May 04 '22 12:05 SimenB

Feel free to open a new issue with a reproduction available

SimenB avatar Nov 16 '22 10:11 SimenB