![](/img/trans.png)
[英]How to pass separate TypeScript config for TSNode when it has being indecency running by Mocha & IntellIJ IDEA?
[英]How to fix Mocha global symbols for TypeScript in IntelliJ IDEA?
從@types/mocha
安裝Mocha @types/mocha
並配置TypeScript編譯器后:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"strictNullChecks": true,
"sourceMap": true,
"inlineSources": true,
"newLine": "lf",
"outDir": "target",
"types": ["node", "mocha"],
"typeRoots": ["./node_modules/@types"]
},
"exclude": [
"node_modules",
"target",
"actors/test",
"actors/typings"
]
}
在IntelliJ IDEA可視編輯器中,對於TypeScript Mocha測試,我仍然收到未解決的全局符號警告/建議:
我該如何解決? 測試成功運行,但是在編輯測試源代碼時,我總是得到這個煩人的彈出窗口。
將Mocha類型從5.2.2
升級到5.2.5
(通過@lena),該問題得以解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.