SlideShare ist ein Scribd-Unternehmen logo
1 von 14
JavaScript Test Driven
Development using JsTestDriver,
 VS 2010, and WebStorm 4.0


  SpeakerRate - http://spkr8.com/t/11601
Who am I?
I am a Microsoft Certified Solution Developer and I’ve
been developing software since 1979. Since 2009, I have
been focused on developing mobile applications, for 
iPhone, Android, the mobile web, and Windows Phone 7.
What is JsTestDriver?
  JsTestDriver aims to help javascript
 developers use good TDD practices
and aims to make writing unit tests as
 easy as what already exists today for
            java with JUnit.
Why JsTestDriver?


• It is fast.
• It runs in the browser.
What is Test Driven
      Development?

• Write a test
• Run tests; watch new test fail
• Make the test pass
• Refactor to remove duplication
The Benefits of TDD

• Regression Testing
• Refactoring
• Cross-Browser Testing
• Serves as Code Documentation
• Helps Create Cleaner Code
Installation
•   Need Java, JRE only.
    http://www.java.com

•   Make sure your path points to the java.exe file

•   Get the latest version of JsTestDriver. http://code.google.com/p/js-test-driver/downloads/list

•   I normally will rename it from JsTestDriver-x.x.x.x.jar to simply JsTestDriver.jar

•   Create your tests and your classes to be tested

•   Create your configuration file in the project root

•   Be sure to save the configuration file as an ASCII file!
    File -> Advanced Save Options -> Encodings -> US-ASCII
Automating the
         JsTestDriver Server
•   Tools -> External Tools

•   Choose Add and for Title box enter: JsTestDriver Server Run

•   Command box enter: java.exe

•   Arguments box enter: -jar c:binJsTestDriver.jar --port 9876

•   Initial directory enter: $(SolutionDir)

•   Check Use Output window then click OK
Automating the
         JsTestDriver Runner
•   Tools -> External Tools

•   Choose Add and for Title box enter: JsTestDriver Run

•   Command box enter: java.exe

•   Arguments box enter: -jar c:binJsTestDriver.jar --tests all

•   Initial directory enter: $(ProjectDir)

•   Check Use Output window then click OK
Create a Test Project
With WebStorm and
           Visual Studio
•   From WebStorm Quick Start, choose Open Directory

•   Navigate to the your Visual Studio project

•   You may need to associate the jstestdriver.conf with a
    configuration file

•   Start the JsTestDriver Server (lower panel on screen)

•   Capture one or more browsers

•   Execute the tests
Summary
JsTestDriver makes it easier to
do Test Driven Development in
          JavaScript.
References

• http://code.google.com/p/js-test-driver/
• http://blog.jetbrains.com/webide/2011/10/javascript-
  unit-testing-support/
• http://slmoloch.blogspot.com/2009/08/how-to-run-
  jstestdriver-with-visual_02.html
Please Rate My Talk:
  SpeakerRate - http://spkr8.com/t/11601



  The Source Code is on GitHub at:
https://github.com/Rockncoder/JQMContacts

Weitere ähnliche Inhalte

Mehr von Troy Miles

Mehr von Troy Miles (20)

Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web Servers
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot Camp
 
AWS Lambda Function with Kotlin
AWS Lambda Function with KotlinAWS Lambda Function with Kotlin
AWS Lambda Function with Kotlin
 
React Native One Day
React Native One DayReact Native One Day
React Native One Day
 
React Native Evening
React Native EveningReact Native Evening
React Native Evening
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
 
Angular Application Testing
Angular Application TestingAngular Application Testing
Angular Application Testing
 
ReactJS.NET
ReactJS.NETReactJS.NET
ReactJS.NET
 
What is Angular version 4?
What is Angular version 4?What is Angular version 4?
What is Angular version 4?
 
Angular Weekend
Angular WeekendAngular Weekend
Angular Weekend
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
The JavaScript You Wished You Knew
The JavaScript You Wished You KnewThe JavaScript You Wished You Knew
The JavaScript You Wished You Knew
 
Build a Game in 60 minutes
Build a Game in 60 minutesBuild a Game in 60 minutes
Build a Game in 60 minutes
 
Quick & Dirty & MEAN
Quick & Dirty & MEANQuick & Dirty & MEAN
Quick & Dirty & MEAN
 
A Quick Intro to ReactiveX
A Quick Intro to ReactiveXA Quick Intro to ReactiveX
A Quick Intro to ReactiveX
 
JavaScript Foundations Day1
JavaScript Foundations Day1JavaScript Foundations Day1
JavaScript Foundations Day1
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

JavaScript Test Driven Development using JsTestDriver, VS 2010, and WebStorm 4.0

  • 1. JavaScript Test Driven Development using JsTestDriver, VS 2010, and WebStorm 4.0 SpeakerRate - http://spkr8.com/t/11601
  • 2. Who am I? I am a Microsoft Certified Solution Developer and I’ve been developing software since 1979. Since 2009, I have been focused on developing mobile applications, for  iPhone, Android, the mobile web, and Windows Phone 7.
  • 3. What is JsTestDriver? JsTestDriver aims to help javascript developers use good TDD practices and aims to make writing unit tests as easy as what already exists today for java with JUnit.
  • 4. Why JsTestDriver? • It is fast. • It runs in the browser.
  • 5. What is Test Driven Development? • Write a test • Run tests; watch new test fail • Make the test pass • Refactor to remove duplication
  • 6. The Benefits of TDD • Regression Testing • Refactoring • Cross-Browser Testing • Serves as Code Documentation • Helps Create Cleaner Code
  • 7. Installation • Need Java, JRE only. http://www.java.com • Make sure your path points to the java.exe file • Get the latest version of JsTestDriver. http://code.google.com/p/js-test-driver/downloads/list • I normally will rename it from JsTestDriver-x.x.x.x.jar to simply JsTestDriver.jar • Create your tests and your classes to be tested • Create your configuration file in the project root • Be sure to save the configuration file as an ASCII file! File -> Advanced Save Options -> Encodings -> US-ASCII
  • 8. Automating the JsTestDriver Server • Tools -> External Tools • Choose Add and for Title box enter: JsTestDriver Server Run • Command box enter: java.exe • Arguments box enter: -jar c:binJsTestDriver.jar --port 9876 • Initial directory enter: $(SolutionDir) • Check Use Output window then click OK
  • 9. Automating the JsTestDriver Runner • Tools -> External Tools • Choose Add and for Title box enter: JsTestDriver Run • Command box enter: java.exe • Arguments box enter: -jar c:binJsTestDriver.jar --tests all • Initial directory enter: $(ProjectDir) • Check Use Output window then click OK
  • 10. Create a Test Project
  • 11. With WebStorm and Visual Studio • From WebStorm Quick Start, choose Open Directory • Navigate to the your Visual Studio project • You may need to associate the jstestdriver.conf with a configuration file • Start the JsTestDriver Server (lower panel on screen) • Capture one or more browsers • Execute the tests
  • 12. Summary JsTestDriver makes it easier to do Test Driven Development in JavaScript.
  • 13. References • http://code.google.com/p/js-test-driver/ • http://blog.jetbrains.com/webide/2011/10/javascript- unit-testing-support/ • http://slmoloch.blogspot.com/2009/08/how-to-run- jstestdriver-with-visual_02.html
  • 14. Please Rate My Talk: SpeakerRate - http://spkr8.com/t/11601 The Source Code is on GitHub at: https://github.com/Rockncoder/JQMContacts

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n