yarn testを実行すると、Cannot find module ‘fs’ or its corresponding type declarations.のエラー
Contents
動作環境
typescript (version 4.8.3)
jest (version 29)
node (version 16)
Resolved (解決方法)
tsconfig.jsonのtypesに"node"を追加したら、テストが通りました。
{
"compilerOptions": {
... 省略 ...
"types": [
"jest",
"node"
]
}
}