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

Advanced java script unit testing - js-il.com

on

  • 1,001 views

js-il.com

js-il.com

Statistics

Views

Total Views
1,001
Views on SlideShare
1,001
Embed Views
0

Actions

Likes
1
Downloads
15
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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.

Advanced java script unit testing - js-il.com Advanced java script unit testing - js-il.com Presentation Transcript

  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Israel JavaScript ConferenceYaniv@UpStruct.nethttp://www.UpStruct.net
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Israel JavaScript ConferenceYaniv@UpStruct.nethttp://www.UpStruct.net
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |including itself
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://qunitjs.comhttps://github.com/jquery/qunit
  • 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>
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |test(‚Sanity Test", function () {ok(1 == 1, Hello QUnit‘);});
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |CommonJS UnitTesting
  • 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‘);});
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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>
  • 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’);
  • 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‘);});});
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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
  • 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
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |http://sinonjs.orghttp://sinonjs.org/qunithttp://sinonjs.org/docs/#server
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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();});});
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • 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
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |
  • Israel JavaScript Conference | 03 – 6325707 | info@e4d.co.il | www.js-il.com |Yaniv@UpStruct.nethttp://www.UpStruct.net