Your SlideShare is downloading. ×
Front-End UnitTesting
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Front-End UnitTesting

498

Published on

How to write unittests, launch multiple browsers and mock data

How to write unittests, launch multiple browsers and mock data

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
498
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Артем Тритяк Unittesting frontend applications at Backbone.js example
  • 2. Why? ❖ Regressions testing is too long! ❖ Short sprints issues! ❖ Dangerous refactoring! ❖ Test API usability! ❖ Отличная отмаза: «Что делаете? Пишем тесты!»
  • 3. What test? Business logic Public API
  • 4. What test? Business logic Public API Model! (Service) Collection Controller
  • 5. What test? Shared functionality Mixins Base! views, controllers, models Helpers
  • 6. Clean your karma
  • 7. Karma Test Runner
  • 8. Karma Test Runner
  • 9. Karma Test Runner
  • 10. Karma Test Runner
  • 11. Runners: Grunt
  • 12. Runners: Gulp
  • 13. Istanbul: Code Coverage
  • 14. Istanbul Karma Gulp
  • 15. Istanbul: Code Coverage
  • 16. Karma + Require.js
  • 17. Karma + Require.js
  • 18. Jasmine 2.0 / Mocha+Chai
  • 19. beforeEach / afterEach
  • 20. Async tests
  • 21. Sinon.js: Mock XHR
  • 22. Sinon.js: Stub methods
  • 23. Sinon.js: Fake and Test ❖ Fake timers: sinon.useFakeTimers();! ❖ Check calls: spy, .calledWith(…), .callCount() etc;! ❖ Have fun
  • 24. Backbone.Model
  • 25. Backbone.Collection
  • 26. Backbone.Collection
  • 27. Backbone.Controller
  • 28. Backbone.Controller? WTF? ❖ https://github.com/artyomtrityak/backbone.controller! ❖ Backbone.Marionette controller! ❖ Backbone.Chaplin controller
  • 29. Backbone.View No tests

×