SlideShare a Scribd company logo
1 of 13
1
CONFIDENTIAL
Andrew Winder
Senior Software Engineer, Message Systems
Testing Javascript with Mocha and
Friends
July 31, 2014
2
Why Testing?
3
What is a test?
expect(something).to.equal(something)
4
What is a test?
expect(something).to.equal(something)
The Subject
5
What is a test?
expect(something).to.equal(something)
The Assertion
6
What Kind of Testing?
7
How to test Javascript?
8
Simple Unit Testing
9
What about Async?
10
What about Async?
11
Mocking with Sinon & Proxyquire
• Use Mocks in unit testing for:
• Stability
• Speed
• Accuracy
• Proxyquire for Mock Injection
• Sinon for creating Mocks
12
Example of ProxyQuire & Sinon.JS
13
Demo & Questions
Twitter: @awinder
andrew.winder@messagesystems.com

More Related Content

What's hot

Re-thinking Test Automation and Test Process Modelling (in pictures)
Re-thinking Test Automation and Test Process Modelling (in pictures)Re-thinking Test Automation and Test Process Modelling (in pictures)
Re-thinking Test Automation and Test Process Modelling (in pictures)Alan Richardson
 
Agile Testing in the Enterprise
Agile Testing in the Enterprise Agile Testing in the Enterprise
Agile Testing in the Enterprise Janet Gregory
 
Escaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product DevelopmentEscaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product DevelopmentMike Clement
 
Appropriate questions for evidence gathering
Appropriate questions for evidence gatheringAppropriate questions for evidence gathering
Appropriate questions for evidence gatheringNMarshall01
 
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...Skelton Thatcher Consulting Ltd
 
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DC
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DCTest Driven Relevancy, Presented by Doug Turnbull at SolrExchage DC
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DCLucidworks (Archived)
 
Working effectively with legacy codes
Working effectively with legacy codesWorking effectively with legacy codes
Working effectively with legacy codesAli Shariat
 
Test Driven Product: Applying Test Driven Thinking to the Product World
Test Driven Product: Applying Test Driven Thinking to the Product WorldTest Driven Product: Applying Test Driven Thinking to the Product World
Test Driven Product: Applying Test Driven Thinking to the Product WorldCprime
 

What's hot (8)

Re-thinking Test Automation and Test Process Modelling (in pictures)
Re-thinking Test Automation and Test Process Modelling (in pictures)Re-thinking Test Automation and Test Process Modelling (in pictures)
Re-thinking Test Automation and Test Process Modelling (in pictures)
 
Agile Testing in the Enterprise
Agile Testing in the Enterprise Agile Testing in the Enterprise
Agile Testing in the Enterprise
 
Escaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product DevelopmentEscaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product Development
 
Appropriate questions for evidence gathering
Appropriate questions for evidence gatheringAppropriate questions for evidence gathering
Appropriate questions for evidence gathering
 
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...
Continuous Delivery antipatterns from the wild - Matthew Skelton - IPEXPO Man...
 
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DC
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DCTest Driven Relevancy, Presented by Doug Turnbull at SolrExchage DC
Test Driven Relevancy, Presented by Doug Turnbull at SolrExchage DC
 
Working effectively with legacy codes
Working effectively with legacy codesWorking effectively with legacy codes
Working effectively with legacy codes
 
Test Driven Product: Applying Test Driven Thinking to the Product World
Test Driven Product: Applying Test Driven Thinking to the Product WorldTest Driven Product: Applying Test Driven Thinking to the Product World
Test Driven Product: Applying Test Driven Thinking to the Product World
 

Viewers also liked

Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoveragemlilley
 
JavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + ChaiJavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + ChaiJames Cryer
 
Unit testing with mocha
Unit testing with mochaUnit testing with mocha
Unit testing with mochaRevath S Kumar
 
Mocha Testing
Mocha TestingMocha Testing
Mocha TestingErick Aky
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with JasmineTim Tyrrell
 
Testing with Express, Mocha & Chai
Testing with Express, Mocha & ChaiTesting with Express, Mocha & Chai
Testing with Express, Mocha & ChaiJoerg Henning
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at PolteqMartijn de Vrieze
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)Anand Bagmar
 
Appium: Prime Cuts
Appium: Prime CutsAppium: Prime Cuts
Appium: Prime CutsSauce Labs
 
DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsAndreas Grabner
 
Alphorm.com Formation TypeScript
Alphorm.com Formation TypeScriptAlphorm.com Formation TypeScript
Alphorm.com Formation TypeScriptAlphorm
 
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)Mudularity and Unit Testing in TypeScript (for ng-bkk #3)
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)Suthep Sangvirotjanaphat
 
Les Aventures d'Alice - la Révolte des Tests
Les Aventures d'Alice - la Révolte des TestsLes Aventures d'Alice - la Révolte des Tests
Les Aventures d'Alice - la Révolte des TestsLy-Jia Goldstein
 

Viewers also liked (17)

Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
 
JavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + ChaiJavaScript Testing: Mocha + Chai
JavaScript Testing: Mocha + Chai
 
Unit testing with mocha
Unit testing with mochaUnit testing with mocha
Unit testing with mocha
 
Mocha Testing
Mocha TestingMocha Testing
Mocha Testing
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with Jasmine
 
Mocha.js
Mocha.jsMocha.js
Mocha.js
 
Testing with Express, Mocha & Chai
Testing with Express, Mocha & ChaiTesting with Express, Mocha & Chai
Testing with Express, Mocha & Chai
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at Polteq
 
Unit Testing TypeScript
Unit Testing TypeScriptUnit Testing TypeScript
Unit Testing TypeScript
 
Agile scrum roles
Agile scrum rolesAgile scrum roles
Agile scrum roles
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
The What, Why and How of (Web) Analytics Testing (Web, IoT, Big Data)
 
Appium: Prime Cuts
Appium: Prime CutsAppium: Prime Cuts
Appium: Prime Cuts
 
DevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback LoopsDevOps Pipelines and Metrics Driven Feedback Loops
DevOps Pipelines and Metrics Driven Feedback Loops
 
Alphorm.com Formation TypeScript
Alphorm.com Formation TypeScriptAlphorm.com Formation TypeScript
Alphorm.com Formation TypeScript
 
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)Mudularity and Unit Testing in TypeScript (for ng-bkk #3)
Mudularity and Unit Testing in TypeScript (for ng-bkk #3)
 
Les Aventures d'Alice - la Révolte des Tests
Les Aventures d'Alice - la Révolte des TestsLes Aventures d'Alice - la Révolte des Tests
Les Aventures d'Alice - la Révolte des Tests
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Test Javascript with Mocha, Sinon and Proxyquire

Editor's Notes

  1. Hi, I’m Andy Winder, and I work here at Message Systems as one of the engineers working on NodeJS APIs, and I wanted to talk today about some of the ways you can test your software, and go through some quick examples of testing JavaScript.
  2. There are 3 main reasons for why we even want to do this whole testing business. We want to be able to ensure the quality of the code as we write it. Testing makes us think of how we’re writing code, and how people will interface with that code (either internally as developers or externally) as users. We want to be able to ensure our code is stable, and that any changes we make to the system don’t have any knock-on effects. We want to be able to refactor code and make sure it still maintains the same external interface. And we also want the security that we are able to change our systems and code without the whole thing blowing up in the future.
  3. A test is a really simple construct, with lots of complexity that ends up coming around it. But at it’s core, testing is really just two parts…
  4. The Subject is something that you want to introspect in your test. It’s usually some kind of output from the code you’re testing. If you’re testing a function, it might be the return value. If you’re testing a system, it might a variable that you look up in a database, or a string of text that you grab off the screen.
  5. The Assertion is what you want to confirm about the subject of the test. You might want to confirm the value is equal to something, or you might want to confirm that it isn’t an error. If the assertion passes, that means your system is behaving as you expect it to. When an assertion fails, that means something is not working correctly within your code.
  6. Three main kinds of testing: Unit testing, Integration Testing, Functional Testing. We write unit tests to make sure that individual objects can be interacted with, in isolation, the way we expect. Integration testing makes sure our objects can be consumed and used by other parts of the system in a stable way. Functional testing makes sure that our system as a whole works as expected in the same way that an end user is going to us the system.
  7. JavaScript has a great ecosystem of tools for testing. Mocha, and alternatively Jasmine, are great test runners. They provide command line tools for running tests, they can help bootstrap environments, and provide different test result outputs to let you know what is passing and failing. Chai is an assertion library that provides the language for writing your tests. Sinon helps you write unit tests, while Protractor helps you test out your Angular apps. All these tools operate both independently and cooperatively with each other.
  8. Imagine we have a method called getVehicleCost that we want to test. It takes in a parameter for the type of vehicle and returns the cost of that vehicle, or an error if we don’t know anything about the vehicle argument. So our tests need to be able to test the conditions that we know about, and the conditions that we don’t know about. We pass in expected arguments, car and boat, and then try to trick the function up by passing something that it doesn’t know about.
  9. But what about asynchronous code? It’s going to be harder to write tests, right?
  10. By handling the “done” function argument in your tests, you can control when the test case is done, and then use that to wait for asynchronous tests to finish up.
  11. Mocking is a technique that is commonly used in unit testing. Remember before we talked about the purpose of unit testing as testing individual units of code, like objects, in isolation. If you have code that depends on third party services like MySQL, or a REST API somewhere, then you would want to replace interactions with those services with a fake, or “mock”, service. This way, you’re testing the unit by itself, rather than its interactions with the full system. This will help you write really fast test suites, that are very dependable, and have less dependencies than when you go to test your full system.
  12. Sinon is a tool that can help with creating mocks. Think back to our example of async testing, where we queried MySQL . We had a call to get a MySQL connection object, then a call to query the database. We can use proxyquire to replace the calls to the MySQL module, and then use “yields” in our query mock to simulate the asynchronous callback from the database. Now our tests don’t rely on even having MySQL set up, and they don’t require any of the connection time & querying time that would normally need to take place. Over time this will save tons of time and is very useful for unit testing, and meeting the goals of unit tests being very stable & predictable.
  13. So to recap, there’s 3 main types of testing: Unit testing, for fine-grained testing of individual modules in our codebases. Integration testing, for seeing how those individual modules connect with each other and start to form the basis for a functioning system. And functional testing, for testing full codebases in the ways users will interact with the system. Mocha, Sinon, and Proxyquire form the basis for really solid unit testing in Node.JS and in frontend / angular codebases. And we got to dig in a little on some examples of how these tests can look when testing out some simple code that connects to MySQL. Thanks for coming out today! Any questions?