際際滷

際際滷Share a Scribd company logo
your project tested
                                nodejs
                                by @edjafarov




弌弍仂舒, 13 从于仆 13 .
structure
                                      unit
                                   frontend

                          code
                                     unit
                           style              functional
                                   backend
                          check

                                    integr.
                                   backend

弌弍仂舒, 13 从于仆 13 .
why tests fail

                            Its taking too long
                            Its too hard to run
                            You dont runem
                            They fail or blink

弌弍仂舒, 13 从于仆 13 .
style check

                jshint
                same as jslint but you can ignore anything
                and test YOUR code style




弌弍仂舒, 13 从于仆 13 .
jshint




弌弍仂舒, 13 从于仆 13 .
unit testing
                     mocha [mk]
                                    test framework for async code
                     chai [t肘]
                                     BDD / TDD assertion library
                     sinon
                          test spies, stubs and mocks for JavaScript
                     rewire
                                      node.js dependency injection

弌弍仂舒, 13 从于仆 13 .
mocha/chai




弌弍仂舒, 13 从于仆 13 .
sinon spy




弌弍仂舒, 13 从于仆 13 .
sinon stub




弌弍仂舒, 13 从于仆 13 .
rewire




弌弍仂舒, 13 从于仆 13 .
integration testing

                     nock
                            HTTP mocking and expectations library
                     localtunnel
                             exposes your localhost to the world




弌弍仂舒, 13 从于仆 13 .
nock




弌弍仂舒, 13 从于仆 13 .
localtunnel




弌弍仂舒, 13 从于仆 13 .
frontend unit testing


         testacular-karma [jasmine/mocha]
                             Spectacular Test Runner for JavaScript.
                                   And you can do test coverage (:




弌弍仂舒, 13 从于仆 13 .
karma con鍖gurator




弌弍仂舒, 13 从于仆 13 .
functional testing


                   PhantomJS 1.8 + require(wd)
          A node.js javascript client for webdriver/selenium 2




弌弍仂舒, 13 从于仆 13 .
Selenium WD




弌弍仂舒, 13 从于仆 13 .
Thanks!
                                                      jshint
                                                    mocha
                                                        chai
                                                      sinon
                          Q&A                        rewire
                                                       nock
                                                localtunnel
                                          testacular-karma
                                          phantomjs + wd
           wanna do hardcore node.js?
           http://bit.ly/fd-debitoor
弌弍仂舒, 13 从于仆 13 .

More Related Content

Your project tested #nodejs