3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jest + eslintでVS Codeが describe を見つけてくれない

Posted at

概要

Node.jsアプリを開発する際にjest + eslintをインストールしてテストケースを書くと、VS Codeが以下の警告を出すが、言う通りにしても解決しない。

毎回対処方法を忘れてしまうので備忘録としてメモ。

名前 'describe' が見つかりません。テスト ランナーの型定義をインストールする必要がありますか? `npm i --save-dev @types/jest` または `npm i --save-dev @types/mocha` をお試しください。

対処方法

.eslintrc.js 等に

module.exports = {
  ...
  env: {
    'jest/globals': true // 追加
  },
  ...
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?