- codeceptionで受け入れテストを用意している場合、ソースや受け入れテストを修正するたびにテスト全部が実行されるのは待ち時間がもったいない。
- gruntは設定ファイルを作成する必要があるので、「ちょっと気楽に」とは難しい
fswatch なら、1linerでディレクトリを監視しながらテストコマンドを実行できます。
※ fswatch は、0.x と 1.x で書式が違っている模様。 https://emcrisostomo.github.io/fswatch/usage.html
fswatch のインストール
$ brew install fswatch
$ source ~/.zshrc # ロードパスやライブラリの再読み込み
$ fswatch --version
fswatch 1.7.0
Copyright (C) 2013-2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Enrico M. Crisostomo.
codeception で1つのceptを実行するテスト
$ codecept run acceptance /path/to/HogeHogeCept
(略)
fswatch と組み合わせ
$ fswatch -o dir1 dir2 | xargs -n1 -I{} codecept run acceptance /path/to/HogeHogeCept