1
1

More than 5 years have passed since last update.

fswatch でディレクトリを監視しながら、codeceptionの1つのceptをテストする

Last updated at Posted at 2016-03-05
  • 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

1
1
2

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