Scripts to ease TDD : watch for files changes and run tests.
Put live-testing.sh at the root of your project, and then edit file to specify how to run unit tests.
At least, you have to edit the runTests()
function by adding a command to run unit tests on our project.
runTests() {
# TODO >>> RUN YOUR TESTS HERE
}
You can also configure the main
part, by changing the watched folder or the timer.
### Main
folder='.'
everySeconds='2'
watch $folder $everySeconds
- Watching for file date changes and sleeping with the same amount of time can lead to some misses.
- Debounce / Throttle execution of tests if there are changes.
- Add a configuration file or parsing arguments for timer, watched folder, unit test command.