The best think about this book is that it starts from the most basic knowledge needed to have a Node.js app tested and guides the reader step-by-step to the end result of a full test suite. Even though readers with some experience on Node.js will need to skip some pages (not many), the first part of this book can be used as a usefull guide on apps' development for less experienced readers. Additionally, throughout the chapters many Node.js libraries are described, with enough details in order to understand their usage and to start writing useful apps on them. Finally, i like the clear and to-the-point descriptions of the writter with the detailed code, that leave no room for confusion, and make setting up your test suite look like much easier than expected before reading this book. I think this is a very good book for every Node.js app developer.
As a beginner to node.js and couchDB i find this to be one of the best resource available out there on the web particularly, if you want to learn how routing, export and templating works using flatiron in node.js. It successfully demonstrates node, flatiron, twitter bootstrap framework, couchDB on building a web application. Theres lot of stuff in it even if you want to start with hands on programming as well. Its worth your time. You can get it here: http://www.packtpub.com/testing-nodej...
The first good thing is that the author himself is a good guarantee, as Pedro Texeira is a renowned author already with his popular Node Tuts video tutorials. What we have here is a book about harnessing the power of Node.js but also of Zombie.js (general purpose web test suite) and Mocha to help testing UI, which means the reader gets introduced to several libraries / frameworks in one package.
The premise, as usual with other books from this publisher, is to keep it short and thorough (I hardly have so much time these days for the proverbial exceeding-the-800-page-count books of the past), building an app at the same time we build the test infrastructure around it- The app is trivial, couldn't be otherwise given the length of the book, but it is a plus anyway since you get a first taste of node.js. Let's see the chapters one by one.
Chapter 1 kicks off by reviewing Zombie.js as the preferred mechanism to test the UI in an easy way. The most interesting part is no doubt the one devoted to the internal workings of the library, more than the DOM or the "history of testing" sections, even if the explanation of testing (to a very basic level such as unit vs integration) can be useful for teams where a discipline of testing has never taken off and a lot of fud remains. In any case, I'd recommend further reading on the subject of headless testing, because the section may fall short for some.
Chapter 2 introduces the total newbie to installing Node and Flatiron, together with the ever useful npm package manager. The version shown in the screenshots in 0.8.7. When I am reading the book it is already 0.10.4. Also the installation of flatiron (an scaffolding fwk) and couchDB are explained. Next, the reader is guided through the process of scaffolding the application with all the bits and pieces that speed up development (packages.json, couchDB twitter bootstrap, jquery), and then go on to actually building the app, beginning with the templates. It's a lot of stuff, but Pedro manages to explain well. The only thing you could say is that the use of a scaffolding framework, as flatiron here, pretty much hides the proper node.js app and its structure.
Chapter 3 covers Zombie.js and Mocha, teaching us how to modify the app so that the headless browser harnesses the app, and how to structure the tests, although Mocha is explained more in-depth in Chapter 4 ("Understanding Mocha"), including a sort of introduction to the discipline of testing, its organization, hooks, assertions, etc.
The nicest about chapter 4 is that test building is carefully guided thru', and we learn how to call pages, check their DOM structure, fill controls and press buttons with the framework objects. It's all very very clear, even if testing a big non trivial app soon introduces some serious complexity. This can be quite useful for those who've never done much testing, either TDD or BDD.
Chapter 5 is a intro to headless browser library Zombie.js (which I personally had not used before). I think you get a pretty clear idea of the basic options you get, how to start testing and how to grow your tests more organically. It's really the longest chapter and the more meaty one. Chapter 2 is actually longer but just because it covers node.js installation and so on. So you could say it is the core of the book.
Chapter 6, continues the testing, widening the scope to deal with interactions, that is testing that when select controls, radio buttons and so on, are selected or manipulated, the app reacts in the expected way.
Chapter 7 is devoted to giving the user some advice regarding debugging, including the Mocha reporters, and specific advice for debugging, running only some tests, such as dumping the contents of the Zombie browser object, etc.
We then move on to the last chapter, 8, Debugging Ajax with Zombie.js. The most interesting part here is how to set up testing for triggering events to test different integrations, for example an actual drag and drop. It's the chapter that maybe feels a bit more rushed. Another example of a different ajax interaction would've been nice.
Some of the chapters run a bit short, but I believe that's a bit of a trade off you need to make if you want to keep the book short, considering that in the end the book reads as a series of tutorials on different libraries with the common goal stated by the title. So, you learn the basics about Mocha, about Zombie.js, a very basic node.js app, etc.
All in all, I should say this is a beginners book. I assume node.js experts already know most of this, or are testing with other libraries. The source code is easy to follow, and only some of the tests get a bit convoluted, but mostly because of javascript's own syntax, and nested functions.
This book is an amazing introduction to the new era of automation testing for web applications, telling how to use the awesome frameworks Mocha and PhantomJS.
If you have some experience in NodeJS, then you will have to jump some of the first pages to fall out into the explanations about using Mocha and Phantom, however the first pages allow that people who would like to start to develop in NodeJS and start to implement test from the beginning, can do that only reading this book and after going deeper on each part with other specific books, tutorials, and so on.
I appreciate to Packt Publishing to give me the opportunity to read this book in its early stage.
This book is great to walk you through from start to finish in building a sample modern web application and how to test it. On each chapter, it describes some sample libraries to use and what they are good for. There are several libraries out there that you can use so it's good that the authors chose something specific to start with. As you get more advanced and gain more knowledge of the application environment, you can then start delving and doing your own research of what other libraries do and that you can use in your project.
5 stars for:
-breaking down the steps in an easy to digest manner -describing thoroughly what is being used and why -clean and concise -describing to the novice what the environment is like and what it's about
Most of the book is about setting up the environment, application and so on. If you read the documentation of zombie js and mocha js you will save some time. This book feels like a tutorial on a decent programming blog.