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
Stefan Teixeira
May 12, 2016
Programming
35
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Stefan Teixeira
See All by Stefan Teixeira
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
stefanteixeira
0
91
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
120
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
75
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
65
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
51
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
140
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
94
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
82
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
68
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
霧の中の代数的エフェクト
funnyycat
1
480
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
580
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.9k
5分で問診!Composer セキュリティ健康診断
codmoninc
0
900
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
580
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
850
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
530
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
220
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
From π to Pie charts
rasagy
0
260
My Coaching Mixtape
mlcsv
0
200
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
520
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
370
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
First, design no harm
axbom
PRO
2
1.2k
Claude Code のすすめ
schroneko
67
230k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Fireside Chat
paigeccino
42
4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
400
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!