Recently I've been getting back into doing some algorithms coding challenge problems, and I really wanted to setup for myself a nice, comfortable coding environment that I could be proud of and that really followed the TDD principles of Uncle Ben, Ken Beck, and all the other gurus. Anyway, this is a guide for setting up simple, barebones TypeScript node.js projects for TDD. I'll show you how to set up a brand new node project, how to make your project a "typescript project", how to add mocha and chai in watch mode, and finally how to see your test results in a nice code coverage report. It's a lot I know, so let's dive into it!
I seriously love using protractor-cucumber-framework, but it can be quite annoying trying to configure it perfectly, especially when you're doing it for the first time. I was having some trouble setting it up with my recent project, and decided to write a post about this specific error that I seem to run into often (hopefully that'll change soon! hehe) when adding this to my projects.
So I'm almost finished reading this book, BDD in Action, by John Ferguson Smart, and I think it is really a fantastic book. Despite the wacky, ugly-looking cover, this is a super-awesome software development book that pretty much revolutionized the way I think about unit testing- and I think a LOT about unit testing so this must be a pretty big deal. I would highly recommend this book to anyone trying to wrap their head around behavior driven development, but in this post I'm going to reveal the crux of BDD- spoiler alert!
Continuous Integration- it might be the last thing I'm lacking that is preventing me from developing in a truly agile, world class programmer level. Nobody loves automated testing more than me, and so I was naturally by this concept of having the unit and e2e tests run each time the code is pushed to the git repo.
If you use the page object pattern when setting up e2e tests (as they are written in the gulp-angular yeoman generated project) then you might want to check that the properties of this page object are actually elements that exist on your page. Indeed, checking that my page object elements exist is almost always the first protractor test that I write. I naively tried a method that didn't work so great at first before finally finding the glorious "isPresent()" method available on my page object elements.
The posts on this site are written and maintained by Jim Lynch. About Jim...