I started a simple project with npm init, then added jest via
npm install jest
How do I make methods like describe()
, test()
, etc., available in.spec.js and.test.js files?
The jest
methods will be available when you run jest
.
Probably your ESLint configuration is not configured for jest and shows that these globals are missing, you can configure them in the eslint configuration :
"env": {
"jest/globals": true
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.