Configuring Jest in WebStorm

Viewed 2208

I'm trying to use Jest to aid Puppeteer testing in WebStorm.

It is my first time using Jest and it looks just the framework I need to help with testing, assertions, setup and teardown etc...

Trouble is, WebStorm won't recognise the keywords e.g. beforeAll, describe, afterAll. Here's a snippet:

enter image description here

My package.json file looks like this:

{
"name": "ui-tests",
"version": "1.0.0",
"description": "End-to-end UI tests",
"author": "John Doe",
"license": "MIT",
"dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.0.17"
},
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "jest",
    "debug": "NODE_ENV=debug npm test",
    "eject": "react-scripts eject"
},
"jest": {
    "testURL": "http://localhost"
},
"devDependencies": {
    "faker": "^4.1.0",
    "jest-cli": "^22.0.4",
    "jest": "^22.0.4",
    "puppeteer": "^1.9.0"
}

}

I have the following plugins installed:

enter image description here

Any ideas?

Thanks

1 Answers
Related