Your SlideShare is downloading. ×
Advanced java script unit testing - js-il.com
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Advanced java script unit testing - js-il.com

645
views

Published on

js-il.com

js-il.com

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
645
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
2
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
  • It’s very much like regular exercise. Everybody knows it’s good, but few people do it.
  • It’s very much like regular exercise. Everybody knows it’s good, but few people do it.
  • It’s very much like regular exercise. Everybody knows it’s good, but few people do it.
  • Transcript

    • 1. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Israel JavaScript ConferenceYaniv@UpStruct.nethttp://www.UpStruct.net
    • 2. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Israel JavaScript ConferenceYaniv@UpStruct.nethttp://www.UpStruct.net
    • 3. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 4. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 5. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 6. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 7. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 8. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 9. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 10. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |SuitestDOHJSUnitLBRTW UThttp://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#JavaScript
    • 11. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 12. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |SuitestDOHJSUnitLBRTW UThttp://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#JavaScript
    • 13. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 14. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 15. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 16. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |including itself
    • 17. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 18. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://qunitjs.comhttps://github.com/jquery/qunit
    • 19. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |<!DOCTYPE html><html><head><link href="Scripts/libs/qunit/qunit-1.10.0.css‛rel="stylesheet" type="text/css" /><script src="Scripts/libs/qunit/qunit-1.10.0.js"type="text/javascript"></script><script src="Scripts/my-tests.js"type="text/javascript"></script></head><body><div id="qunit"></div><div id="qunit-fixture"></div></body></html>
    • 20. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |test(‚Sanity Test", function () {ok(1 == 1, Hello QUnit‘);});
    • 21. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 22. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 23. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |CommonJS UnitTesting
    • 24. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |module("Tests and Modules", {// Runs before each testsetup: function () {},// Runs after each testteardown: function () {}});test(‚Sanity Test", function () {ok(1 == 1, Hello QUnit‘);});
    • 25. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 26. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 27. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 28. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |<!DOCTYPE html><html><head><link href="Scripts/libs/qunit/qunit-1.10.0.css‚rel="stylesheet" type="text/css" /><script src="Scripts/libs/qunit/qunit-1.10.0.js"type="text/javascript"></script><script data-main="scripts/main-tests"src="scripts/libs/require/require.js"type="text/javascript"></script></head></html>
    • 29. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Data what?<div id=‚product‛ data-identity=‚3‛>…</div>var productId = $(‘#product’).data(‘identity’);
    • 30. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |require(["jquery","underscore‚], function ($, _) {module("Tests and Modules", {setup: function () {},teardown: function () {}});test(‚Sanity Test", function () {ok(1 == 1, Hello QUnit‘);});});
    • 31. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 32. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 33. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 34. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://code.google.com/p/js-test-driverhttps://github.com/exnor/QUnit-to-JsTestDriver-adapter
    • 35. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 36. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |server: http://localhost:9876basepath: ""load:- jquery.js- qunit.js- sinon.jstest:- test.jsserve:- module.jsplugin:# Plug-Ins
    • 37. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |-jar JsTestDriver.jar --port 9876--browser"chrome.exe","Safari.exe‚, ‚iexplore.exe‛-jar JsTestDriver-1.3.5.jar--server http://localhost:9876--tests all--testOutput "jsTestDriver-TestResults"--verbose
    • 38. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 39. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 40. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 41. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://sinonjs.orghttp://sinonjs.org/qunithttp://sinonjs.org/docs/#server
    • 42. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 43. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |require(["jquery","underscore","tests/calculator"], function ($, _, calculator) {test("Stub method", function () {var stub = sinon.stub(calculator, "sum",function (num1, num2) {return num1 - num2;});var sum = calculator.sum(5, 3);equal(sum, 2, "Expected 2");stub.restore();});});
    • 44. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 45. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 46. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 47. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 48. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 49. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#JavaScriptPart I Part II Part III
    • 50. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
    • 51. Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Yaniv@UpStruct.nethttp://www.UpStruct.net