0
0

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のdescribeやitに赤線が出る

Posted at

エラー内容

ドキュメントを参考にNextでjestを導入したところ、VSCodeでdescribeitで eslintエラーが出ていた

エラー文言は

'describe' is not defined. eslint(no-undef)`
実際のコード エラー内容
image.png image.png

解決方法

eslint-plugin-jest をインストールして、設定ファイル(.eslintrc.js)に追記するので解決

  1. eslint-plugin-jest をインストール
    $ npm i -D eslint-plugin-jest
    
  2. 設定ファイル(.eslintrc.js)に追記
    envに'jest/globals': trueをpluginsに'jest'を追加

以上で解決

参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?