Jestでテストしたら、watchmanで警告が出た
具体的には、以下の警告内容です。そもそもJestが初心者レベルです。
$ npm run test
> expo3@1.0.0 test
> jest
watchman warning: Recrawled this watch 1 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/[ユーザ名]/yyyy/react-native/[プロジェクト名]' ; watchman watch-project '/Users/[ユーザ名]/yyyy/react-native/[プロジェクト名]'`
Contents
解決方法
警告文の最後の行が、watchmanのキャッシュを削除するコマンドでした。最初、よくわからなかったが、恐る恐る実行したら、警告が出なくなりました。
watchman watch-del '/Users/[ユーザ名]/yyyy/react-native/[プロジェクト名]'
watchman watch-project '/Users/[ユーザ名]/yyyy/react-native/[プロジェクト名]'
Note (備考)
以下のようにexpo startした際にも、同様にwatchmanのエラーが出ました。解決方法も同様でした。度々出てくるエラーなんですね。
$ expo start
Logs for your project will appear below. Press Ctrl+C to exit.
Recrawled this watch 5 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/username/expo/QuizApp45' ; watchman watch-project '/Users/[username]/expo/QuizApp45'`
$ watchman watch-del '/Users/username/expo/QuizApp45'
{
"version": "2022.08.22.00",
"watch-del": true,
"root": "/Users/username/expo/QuizApp45"
}
$ watchman watch-project '/Users/username/expo/QuizApp45'
{
"version": "2022.08.22.00",
"watch": "/Users/username/expo/QuizApp45",
"watcher": "fsevents"
}
めでたし、めでたし。