Jestでテストを書く際にdescribe functionを使うと、describe functionが定義されていないので「‘describe’ is not defined.(no-undef)」というeslintのエラーが出ることがありますが、eslint.jsに下記の設定を追加すれば解消します。
"env": {
"jest": true
}
同様にmocha関連のfuncionを使用した際にも「‘xxxxxx’ is not defined.(no-undef)」などが出ることがありますが、これも
"env": {
"mocha": true
}
と追記すれば解消します。
コメント