Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TDC 2016 Floripa - Testando APIs REST com Super...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stefan Teixeira
May 12, 2016
Programming
0
32
TDC 2016 Floripa - Testando APIs REST com Supertest e Promises
Palestra apresentada na trilha JavaScript do TDC 2016 Florianópolis, no dia 12 de Maio
Stefan Teixeira
May 12, 2016
Tweet
Share
More Decks by Stefan Teixeira
See All by Stefan Teixeira
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
stefanteixeira
0
82
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
110
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
67
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
55
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
45
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
130
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
86
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
75
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
61
Other Decks in Programming
See All in Programming
組織で育むオブザーバビリティ
ryota_hnk
0
170
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
2
130
Oxlintはいいぞ
yug1224
5
1.3k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
0
190
CSC307 Lecture 06
javiergs
PRO
0
680
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
230
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
Data-Centric Kaggle
isax1015
2
760
Apache Iceberg V3 and migration to V3
tomtanaka
0
140
CSC307 Lecture 07
javiergs
PRO
0
540
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
88
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
420
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
62
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
820
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
RailsConf 2023
tenderlove
30
1.3k
Transcript
Globalcode – Open4education Testando APIs REST com Supertest e Promises
Stefan Teixeira
[email protected]
/ stefanteixeira.com.br
• QA Automation Engineer • Entusiasta de Automação de Testes,
Agile Testing e DevOps • Blogs técnicos: stefanteixeira.com.br (pt-br) / stefanteixeira.com (en) Contatos: • E-mail:
[email protected]
• Twitter: twitter.com/stefan_teixeira • LinkedIn: linkedin.com/in/stefanteixeira • GitHub: github.com/stefanteixeira • SlideShare: slideshare.net/stefanteixeira Sobre
Vocês testam suas APIs REST?
Testando APIs REST
Qual lib usar?
Qual lib usar?
Qual lib usar?
Supertest • Criado pelo TJ Holowaychuk https://www.npmjs.com/package/supertest | https://github.com/visionmedia/supertest
Supertest • Criado pelo TJ Holowaychuk • MUITO simples https://www.npmjs.com/package/supertest
| https://github.com/visionmedia/supertest
Supertest • Criado pelo TJ Holowaychuk • MUITO simples •
Independente de runner (Jasmine, Mocha, etc) https://www.npmjs.com/package/supertest | https://github.com/visionmedia/supertest
Exemplos
GET
POST
E com testes mais complexos?
Callback Hell
Promises!
supertest-as-promised https://www.npmjs.com/package/supertest-as-promised https://github.com/WhoopInc/supertest-as-promised
E o teste com Promises?
Projeto de exemplo https://github.com/stefanteixeira/demo-supertest
Globalcode – Open4education Stefan Teixeira @stefan_teixeira
[email protected]
stefanteixeira.com.br stefanteixeira.com Obrigado!