[英]Intellij idea not recognizing mochajs keywords like 'describe', beforeAll, it, etc
我只是在 Intellij Idea 中使用 mochajs 建立一個小型學習項目。 我可以成功運行一個簡單的測試,但 Intellij 的想法似乎無法識別關鍵字“describe”、“beforeAll”、“it”...等。 我怎樣才能解決這個問題?
{
"name": "seleniumjs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/mocha --no-timeout ./tests/*.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {},
"devDependencies": {
"mocha": "^8.2.1",
"selenium-webdriver": "^4.0.0-alpha.7"
}
}
Mocha 不公開其全局變量,因此讓靜態代碼分析識別這些方法的唯一方法是安裝npm i @types/mocha
( npm i @types/mocha
)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.