gpt4 book ai didi

javascript - 带有 Mono Repo 的 react-scripts 的 testPattern --config=jest.config.js 无效

转载 作者:行者123 更新时间:2023-12-05 00:28:03 25 4
gpt4 key购买 nike

我正在尝试通过以下方式将自定义 jest.config 设置为 react-scripts:"test": "react-scripts test -- --config=jest.config.js",我觉得重要的是要提到我有一个单一的 repo 。
但是,这产生了以下错误:

Invalid testPattern --config=jest.config.js|--watch|--config|{"roots":["<rootDir>/src"],"collectCoverageFrom":["src/**/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"],"setupFiles":["/var/www/tractable/property-estimating/node_modules/react-app-polyfill/jsdom.js"],"setupFilesAfterEnv":["<rootDir>/src/setupTests.ts"],"testMatch":["<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}","<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"],"testEnvironment":"jsdom","testRunner":"/var/www/tractable/property-estimating/node_modules/jest-circus/runner.js","transform":{"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$":"/var/www/tractable/property-estimating/node_modules/react-scripts/config/jest/babelTransform.js","^.+\\.css$":"/var/www/tractable/property-estimating/node_modules/react-scripts/config/jest/cssTransform.js","^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)":"/var/www/tractable/property-estimating/node_modules/react-scripts/config/jest/fileTransform.js"},"transformIgnorePatterns":["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"],"modulePaths":["/var/www/tractable/property-estimating/frontend/claim-handler/src"],"moduleNameMapper":{"^react-native$":"react-native-web","^.+\\.module\\.(css|sass|scss)$":"identity-obj-proxy"},"moduleFileExtensions":["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"],"watchPlugins":["jest-watch-typeahead/filename","jest-watch-typeahead/testname"],"resetMocks":true,"rootDir":"/var/www/tractable/property-estimating/frontend/claim-handler"}|--env|/var/www/tractable/property-estimating/node_modules/jest-config/node_modules/jest-environment-jsdom/build/index.js supplied. Running all tests instead.
版本
"react-scripts": "4.0.3",

最佳答案

你试过了吗:"test": "react-scripts test --config=jest.config.js" ?
这可能有效

关于javascript - 带有 Mono Repo 的 react-scripts 的 testPattern --config=jest.config.js 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68526300/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com