![]() ![]() ![]() In fact, the first project I set up the PHPUnit watcher script on was a PHP project that also preprocesses files. Since starting to work on these projects, I’ve started to set a similar thing up for PHPUnit. The code for this tutorial can be found on Github. This way, I can immediately see if I’ve broken anything. ![]() When I change the JavaScript files, these files are transformed and the unit tests are re-run. These projects I’ve worked on have used a similar approach to re-run unit tests. In order to reduce the burden of invoking the transformation scripts, boilerplate projects have started to include scripts to automatically watch for file changes and thereafter invoke these scripts. In the land of JavaScript, developers write in syntax not widely supported, and the code is transformed into syntax that is widely supported, usually using a tool called Babel. In the land of JavaScript, it’s not uncommon to preprocess source code. Here’s a great premium video tutorial about test driven NodeJS development! I recently started working on a few JavaScript projects which had bundled test watchers. And I’m still learning what good tests look like. It’s taken many years, and wise words from people like Chris Hartjes, for me to see the value in testing. In fact, most of the jobs I’ve had have been with companies who don’t much care for other forms of testing. Like many before and since, my “testing” was to write code and refresh the page. I didn’t start out writing tests for my code. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! This article was peer reviewed by Younes Rafie. ![]()
0 Comments
Leave a Reply. |