SlideShare ist ein Scribd-Unternehmen logo
1 von 16
JavaScript Testing—
Technically not a number…
Justin Obney, Front-End Dev
Gone are the days of old
Any application that can be
written in JavaScript, will be
written in JavaScript
-- Atwood’s
Law
JS is everywhere
That no one thinks they need to
actually learn how it works.
Looks like C or Java… How
hard could it be?
JavaScript is so
approachable
• The old way
• Frameworks
• The lies
• Where to start
• Tooling
• Who knows?
The Agenda
“Whenever you are tempted to
type something into a print
statement or a debugger
expression, write it as a test
instead.”
—Martin Fowler
When do I write a test?
Testing Frameworks
•A unit test is code that executes
part of your production code
with an expectation on the
result.
•Unit vs. Integration
•Mocking & Stubbing
•Vocabulary
But testing is hard…
But the DOM
Tooling
TEST’EM
I see you are on a Mac…
But what about Windows?
But does it scale?
In closing
Thank You
justinobney@gmail.com
twitter.com/justinobney
github.com/justinobney
apply@envoccareers.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

A Mockery of a persentation
A Mockery of a persentationA Mockery of a persentation
A Mockery of a persentation
 
Fast end-to-end-tests
Fast end-to-end-testsFast end-to-end-tests
Fast end-to-end-tests
 
Isotope
IsotopeIsotope
Isotope
 
A/B Testing That Matters
A/B Testing That MattersA/B Testing That Matters
A/B Testing That Matters
 
It's Not Just a Phase: Learning To Love Full Stack Development
It's Not Just a Phase: Learning To Love Full Stack DevelopmentIt's Not Just a Phase: Learning To Love Full Stack Development
It's Not Just a Phase: Learning To Love Full Stack Development
 
Nhu Viet Nguyen "Why C++ is Becoming a Necessity for QA Automation"
Nhu Viet Nguyen "Why C++ is Becoming a Necessity for QA Automation"Nhu Viet Nguyen "Why C++ is Becoming a Necessity for QA Automation"
Nhu Viet Nguyen "Why C++ is Becoming a Necessity for QA Automation"
 
Learned from Woodworking
Learned from WoodworkingLearned from Woodworking
Learned from Woodworking
 
7 lessons learned building high availability / performance systems - CM2015
7 lessons learned building high availability / performance systems - CM20157 lessons learned building high availability / performance systems - CM2015
7 lessons learned building high availability / performance systems - CM2015
 
Good Enough Prototype (Ivan Pashko Product Stream)
Good Enough Prototype (Ivan Pashko Product Stream)Good Enough Prototype (Ivan Pashko Product Stream)
Good Enough Prototype (Ivan Pashko Product Stream)
 
Test Driven Development: More Development Than Ever
Test Driven Development: More Development Than EverTest Driven Development: More Development Than Ever
Test Driven Development: More Development Than Ever
 
The Way of The Software Craftsman # Part One: The Beginning
The Way of The Software Craftsman # Part One: The BeginningThe Way of The Software Craftsman # Part One: The Beginning
The Way of The Software Craftsman # Part One: The Beginning
 
Lean Responsive
Lean ResponsiveLean Responsive
Lean Responsive
 
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
Session #3: "It Works on My Machine!" Closing the Loop Between Development & ...
 
How to code in the XXI century without losing your head
How to code in the XXI century without losing your headHow to code in the XXI century without losing your head
How to code in the XXI century without losing your head
 
Felt - Front end load testing
Felt - Front end load testingFelt - Front end load testing
Felt - Front end load testing
 
Testing javascript
Testing javascriptTesting javascript
Testing javascript
 
The Front End Testing Frontier - RubyConf 2010
The Front End Testing Frontier - RubyConf 2010The Front End Testing Frontier - RubyConf 2010
The Front End Testing Frontier - RubyConf 2010
 
Understand the system
Understand the systemUnderstand the system
Understand the system
 

Ähnlich wie Unit testing JS = SQLSat 324

Best practices for JavaScript RIAs
Best practices for JavaScript RIAsBest practices for JavaScript RIAs
Best practices for JavaScript RIAs
Carlos Ble
 
GeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testingGeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testing
Jakub Marchwicki
 
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
Peter Presnell
 
Waterfalls for Agile in a bag
Waterfalls for Agile in a bagWaterfalls for Agile in a bag
Waterfalls for Agile in a bag
Steve Wells
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
John Choi
 

Ähnlich wie Unit testing JS = SQLSat 324 (20)

Testing Storm components with Groovy and Spock
Testing Storm components with Groovy and SpockTesting Storm components with Groovy and Spock
Testing Storm components with Groovy and Spock
 
TDD super mondays-june-2014
TDD super mondays-june-2014TDD super mondays-june-2014
TDD super mondays-june-2014
 
Testacular
TestacularTestacular
Testacular
 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
 
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in FlexassertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
assertYourself - Breaking the Theories and Assumptions of Unit Testing in Flex
 
Unit testing
Unit testingUnit testing
Unit testing
 
Dark side of JS development framework
Dark side of JS development frameworkDark side of JS development framework
Dark side of JS development framework
 
QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training
 
The JavaScript Delusion
The JavaScript DelusionThe JavaScript Delusion
The JavaScript Delusion
 
Best practices for JavaScript RIAs
Best practices for JavaScript RIAsBest practices for JavaScript RIAs
Best practices for JavaScript RIAs
 
Scrum Gathering 2012 Shanghai_敏捷测试与质量管理分会场演讲话题:getting to done by testing at ...
Scrum Gathering 2012 Shanghai_敏捷测试与质量管理分会场演讲话题:getting to done by testing at ...Scrum Gathering 2012 Shanghai_敏捷测试与质量管理分会场演讲话题:getting to done by testing at ...
Scrum Gathering 2012 Shanghai_敏捷测试与质量管理分会场演讲话题:getting to done by testing at ...
 
Tdd - introduction
Tdd - introductionTdd - introduction
Tdd - introduction
 
GeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testingGeeCON 2012 hurdle run through ejb testing
GeeCON 2012 hurdle run through ejb testing
 
Javascript test automation demo
Javascript test automation demoJavascript test automation demo
Javascript test automation demo
 
I Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application TestingI Smell A RAT- Rapid Application Testing
I Smell A RAT- Rapid Application Testing
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
Waterfalls for Agile in a bag
Waterfalls for Agile in a bagWaterfalls for Agile in a bag
Waterfalls for Agile in a bag
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
Lessons Learned When Automating
Lessons Learned When AutomatingLessons Learned When Automating
Lessons Learned When Automating
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 

Kürzlich hochgeladen

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Unit testing JS = SQLSat 324

Hinweis der Redaktion

  1. Who am I Envoc .Net beginning now they pay me to write JavaScript The web is changing rapidly The good old days WEB FORMS: post a form let the server build 1/2 MB or html and then send it back to the client to change a radio button … Cue magic
  2. Some of you may still live there... Get out now… JavaScript on rise
  3. Atwood’s Law CodingHorror StackOverflow it runs everywhere The server Mobile apps TVs? PS4? Heard of the web.. it is here to stay.
  4. 0.1 + 0.2
  5. console.log has the nasty risk of introducing bugs all on its own. enter dev tools (`debugger;`)
  6. QUnit older, more support mocha can drop in any* assertion library jasmine headless browser support built in spies & mocks
  7. Vocabulary A unit test is code that executes part of your production code with an expectation on the result. Unit vs integration unit - should be able to trust they should all be green integration - sometimes fail due to circumstance/environment Mocking and stubbing Mocks - you expect to assert against value (1 per test) Stubs - fake calls out. can have many
  8. ----- Meeting Notes (4/8/14 20:43) ----- Gmail, Facebook, Twitter, Azure Management Portal Models, Controllers, Services, Smart Caching, DI -- All things that can live in the client now
  9. ----- Meeting Notes (4/8/14 20:48) ----- Most of the tooling you will find will run on NodeJS Node has made Windows a first class citizen. You can integrate it into most of your existing CI servers. The only thing stopping you is you.
  10. This is not library code. There is very little DOM manipulation going on here (SPA). This is application logic.