Reactjs Graphql:Typescript+;开玩笑+;继电器+;开玩笑可以';他们似乎没有融合在一起
我正在测试用Typescript和Relay构建的React应用程序。当我尝试测试继电器供电部件时,我遇到以下错误:Reactjs Graphql:Typescript+;开玩笑+;继电器+;开玩笑可以';他们似乎没有融合在一起,reactjs,typescript,graphql,relayjs,relaymodern,Reactjs,Typescript,Graphql,Relayjs,Relaymodern,我正在测试用Typescript和Relay构建的React应用程序。当我尝试测试继电器供电部件时,我遇到以下错误: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`. 我有以下.babelrc文件: {
Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`.
我有以下.babelrc文件:
{
"presets": ["@babel/env", "@babel/react"],
"plugins": ["relay",
[
"transform-relay-hot",
{
"schema": "./schema.graphql",
"watchInterval": 2000,
"verbose": true
}
]
]
}
以及以下Jest配置:
module.exports = {
roots: ["<rootDir>/src"],
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testRegex : "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
moduleFileExtensions : ["ts", "tsx", "js", "jsx", "json", "node"],
transformIgnorePatterns : ["node_modules/(?!(date-fns))"],
moduleNameMapper: {
"^Apps(.*)$" : "<rootDir>/src/apps$1",
"^Pages(.*)$" : "<rootDir>/src/pages$1",
"^Components(.*)$": "<rootDir>/src/components$1",
"^Logic(.*)$" : "<rootDir>/src/logic$1",
"^Theme(.*)$" : "<rootDir>/src/theme$1",
"^Config(.*)$" : "<rootDir>/src/config$1",
"^Public(.*)$" : "<rootDir>/src/public$1",
},
globals: {
'ts-jest': {
tsConfig: "tsconfig.json",
// diagnostics: false
}
},
setupTestFrameworkScriptFile: "./src/test/test.setup.ts"
};
module.exports={
根:[“/src”],
转换:{
“^.+\\.tsx?$”:“ts玩笑”,
},
testRegex:“(/\uuuu tests./**(\\.\124;/)(test | spec))\\\\.tsx?$”,
moduleFileExtensions:[“ts”、“tsx”、“js”、“jsx”、“json”、“节点”],
transformIgnorePatterns:[“节点模块/(?!(日期fns))”,
模块映射:{
“^Apps(.*)$”:“/src/Apps$1”,
“^Pages(.*)$”:“/src/Pages$1”,
“^Components(.*)$”:“/src/Components$1”,
“^Logic(.*)$”:“/src/Logic$1”,
“^Theme(.*)$”:“/src/Theme$1”,
“^Config(.*)$”:“/src/Config$1”,
“^Public(.*)$”:“/src/Public$1”,
},
全球:{
“开玩笑”{
tsConfig:“tsConfig.json”,
//诊断:错误
}
},
SetupTestFrameworkScript文件:“./src/test/test.setup.ts”
};
我是不是遗漏了什么 你好@ejaz karim!你的问题解决了吗?我有同样的。你能分享你的决定吗?