It should be noted that you can be running your angular application locally and testing it in your browser (updating automatically when a file changes from good old browsersyc) while at the same time you have your tests runner (karma, in my case) running from the command line with autoWatch turned on. This is a fantastic way to develop. I have said many times that I feel browsersync spoils developers and leads them away from TDD and good testing, but actually browsersync can be pretty useful to have open as a sanity check with the unit tests as your main source of truth. Here's a meme that I created from the "Why not Both?" image:
The syntax of "gulp serve" and "gulp test:auto" my be different for your project of course, but it's the default commands for my favorite yeoman generator, Gulp-Angular. Beginners Angular devs are sometimes unaware that you can have both running at the same time to update automatically while watching your files. Simply open up a new terminal window, cd down into the project's root directory, and call the other command. Viola! You can even open a third command line window and run gulp protractor:auto for what I call, "triple whammy testing".
Your comment will be posted after it is approved.
Leave a Reply.
The posts on this site are written and maintained by Jim Lynch. About Jim...