Fix Jest tests ESLint errors

Published on August 22nd, 2019

eslint icon

Ah those ESLint errors again… At least they are easy to fix.

Just install eslint-plugin-jest as dev dependency.

yarn add -D eslint-plugin-jest

And add following properties to your .eslintrc.

{
  ...
  "extends": [..., "plugin:jest/recommended", ...]
  "plugins": ["jest"]
  "env": {
      "jest/globals": true
  }
  ...
}

Enjoy your error-free Jest tests!