Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Jest - Do more, spend less time
Search
Christian Fortes
April 02, 2018
Programming
40
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jest - Do more, spend less time
Christian Fortes
April 02, 2018
More Decks by Christian Fortes
See All by Christian Fortes
Tech Track - Angular 2 (Part 2)
chrisgfortes
0
55
Tech Track - Angular 2 (Part 3)
chrisgfortes
0
34
Tech Track - Angular 2 (Part 1)
chrisgfortes
0
55
Uma breve introdução sobre AngularJS 1.x
chrisgfortes
0
30
Other Decks in Programming
See All in Programming
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
520
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.7k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.2k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
230
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Statistics for Hackers
jakevdp
799
230k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Transcript
Jest Do more, spend less time
Jest @chrisgfortes Jest? O que é? - Delightful JavaScript Testing
- Designed for React / ES6 - Developed by Facebook
Jest @chrisgfortes - Easy setup - Built-in code coverage reports
- Powerful mocking library - Snapshot Testing - Works with TypeScript - Complete library (No dependencies) Mas por que usar?
Jest @chrisgfortes Exemplo
Jest @chrisgfortes Código function sum(a, b) { return a +
b; } module.exports = sum; sum.js
Jest @chrisgfortes Escrevendo o teste const sum = require('./sum'); test('adds
1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); }); sum.test.js
Jest @chrisgfortes Install and Run console$ npm install --save-dev jest
console$ jest
Jest @chrisgfortes Result PASS ./sum.test.js ✓ adds 1 + 2
to equal 3 (5ms)
Jest @chrisgfortes Mas cadê a configuração????
Jest @chrisgfortes Zero configuration!!!!!!
Jest @chrisgfortes - sum.js (write a code js) - sum.test.js
(write your test) - Run a command (jest) Configuração é:
Jest @chrisgfortes Coverage console$ jest --coverage --collectCoverageFrom=[src/**/*.js]
Jest @chrisgfortes Coverage result:
Jest @chrisgfortes Reports (Istanbul) Jest use the report of Istanbul
https://github.com/gotwarlost/istanbul
Jest @chrisgfortes config.json { "verbose": true, "rootDir": "../../", "coverageDirectory": "test/coverage/",
"coverageReporters": [ "html" ], "collectCoverage": true, "collectCoverageFrom": [ "src/**/*.js", "!**/node_modules/**" ] }
Jest @chrisgfortes Usando config.json console$ jest -c ./config.json console$ jest
-c ./config.json --watchAll (Watch mode)
Jest Thanks! @chrisgfortes