SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Just Test It
Karma, Mocha, Sinon.js

Artyom Trityak
Why test?
It’s impossible to do regression testing for big projects
Want to do refactoring - test it!
Want to deploy each sprint - test it!
Want to show how to use your module - test it!
What test?
Business logic
What test?
Business logic where?

Models
Controllers
Views
What test?
Business logic
Models
Controllers
What test?
Business logic
Models
Controllers
Shared functionality (base classes, utils etc)
How test: Karma
Runs your unittests in different browsers automatically:
Chrome, Phantomjs, Firefox, Safari, IE
Run-on-change
Test in real devices: phones, tablets etc
How test: Karma
How test: Sinon.js
Mock modules dependencies
Mock backend requests and responses
Mock / stub methods and objects
Check methods calledWith and callCount
How test: Sinon.js
How test: Mocha+Chai
or Jasmine

Test async behaviors
Different reports
Both fine: Mocha+Chai or Jasmine (2.0 is out)
Jasmine 2.0 supports Mocha-style «done» callback for
async tests
How test: Mocha+Chai
or Jasmine
How test: Mocha+Chai
or Jasmine
How test: Require.js
Test modular code
Clean state for each test
How test: Require.js
Just Test It

Contenu connexe

Tendances

Tendances (8)

Patterns in Test Automation
Patterns in Test AutomationPatterns in Test Automation
Patterns in Test Automation
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object Pattern
 
Tomer Shiri - A Bug's Life - How to Avoid Production Catastrophes
Tomer Shiri - A Bug's Life - How to Avoid Production CatastrophesTomer Shiri - A Bug's Life - How to Avoid Production Catastrophes
Tomer Shiri - A Bug's Life - How to Avoid Production Catastrophes
 
Brace yourself from automation death trap
Brace yourself from automation death trapBrace yourself from automation death trap
Brace yourself from automation death trap
 
Patterns of a “good” test automation framework
Patterns of a “good” test automation frameworkPatterns of a “good” test automation framework
Patterns of a “good” test automation framework
 
Enabling CD in Enterprises with Testing
Enabling CD in Enterprises with TestingEnabling CD in Enterprises with Testing
Enabling CD in Enterprises with Testing
 
jDriver Presentation
jDriver PresentationjDriver Presentation
jDriver Presentation
 
Functional Testing
Functional TestingFunctional Testing
Functional Testing
 

Similaire à Just Test It

Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
Automation testing real time interview question.pdf
Automation testing real time interview question.pdfAutomation testing real time interview question.pdf
Automation testing real time interview question.pdf
Enjoyr
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
Vijayan Reddy
 

Similaire à Just Test It (20)

Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glance
 
Unit Testing with Jest
Unit Testing with JestUnit Testing with Jest
Unit Testing with Jest
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
 
Qa process
Qa processQa process
Qa process
 
Testing w-mocks
Testing w-mocksTesting w-mocks
Testing w-mocks
 
Functional tests in_symfony
Functional tests in_symfonyFunctional tests in_symfony
Functional tests in_symfony
 
軟體測試是在測試什麼?
軟體測試是在測試什麼?軟體測試是在測試什麼?
軟體測試是在測試什麼?
 
A Sampling of Tools
A Sampling of ToolsA Sampling of Tools
A Sampling of Tools
 
Qa process
Qa processQa process
Qa process
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Automation testing real time interview question.pdf
Automation testing real time interview question.pdfAutomation testing real time interview question.pdf
Automation testing real time interview question.pdf
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
 
Flex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative AnalysisFlex Mock Testing Frameworks: Comparative Analysis
Flex Mock Testing Frameworks: Comparative Analysis
 
Testing Mozilla Web Properties
Testing Mozilla Web PropertiesTesting Mozilla Web Properties
Testing Mozilla Web Properties
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 

Plus de Artyom Trityak

Requirejs in details v2
Requirejs in details v2Requirejs in details v2
Requirejs in details v2
Artyom Trityak
 
Green orange: Gruntjs, Mocha, Testacular (Karma)
Green orange: Gruntjs, Mocha, Testacular (Karma)Green orange: Gruntjs, Mocha, Testacular (Karma)
Green orange: Gruntjs, Mocha, Testacular (Karma)
Artyom Trityak
 

Plus de Artyom Trityak (16)

Data fetching in React.js
Data fetching in React.jsData fetching in React.js
Data fetching in React.js
 
React Native
React NativeReact Native
React Native
 
React.js and Flux in details
React.js and Flux in detailsReact.js and Flux in details
React.js and Flux in details
 
React.js for Back-End developers
React.js for Back-End developersReact.js for Back-End developers
React.js for Back-End developers
 
Component-based Front-End architecture
Component-based Front-End architectureComponent-based Front-End architecture
Component-based Front-End architecture
 
Чик чик и в продакшн: быстрый обзор маленьких библиотек для большого Backbone...
Чик чик и в продакшн: быстрый обзор маленьких библиотек для большого Backbone...Чик чик и в продакшн: быстрый обзор маленьких библиотек для большого Backbone...
Чик чик и в продакшн: быстрый обзор маленьких библиотек для большого Backbone...
 
Front-End UnitTesting
Front-End UnitTestingFront-End UnitTesting
Front-End UnitTesting
 
FrontEnd Unit testing
FrontEnd Unit testingFrontEnd Unit testing
FrontEnd Unit testing
 
Requirejs in details v2
Requirejs in details v2Requirejs in details v2
Requirejs in details v2
 
Modern front-end
Modern front-endModern front-end
Modern front-end
 
Backbonejs Full Stack
Backbonejs Full StackBackbonejs Full Stack
Backbonejs Full Stack
 
CoffeeScript a-zA-Z
CoffeeScript a-zA-ZCoffeeScript a-zA-Z
CoffeeScript a-zA-Z
 
Sinonjs mocks
Sinonjs mocksSinonjs mocks
Sinonjs mocks
 
Backbone widget apps
Backbone widget appsBackbone widget apps
Backbone widget apps
 
Green orange: Gruntjs, Mocha, Testacular (Karma)
Green orange: Gruntjs, Mocha, Testacular (Karma)Green orange: Gruntjs, Mocha, Testacular (Karma)
Green orange: Gruntjs, Mocha, Testacular (Karma)
 
Require.js in details
Require.js in detailsRequire.js in details
Require.js in details
 

Dernier

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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 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)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 

Just Test It