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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Stefan Teixeira
May 12, 2016
Programming
33
0
Share
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
86
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
120
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
70
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
59
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
50
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
88
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
79
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
64
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
410
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
460
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
300
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
120
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
2
630
net-httpのHTTP/2対応について
naruse
0
420
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.2k
AIとRubyの静的型付け
ukin0k0
0
510
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
410
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
200
74k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
The Limits of Empathy - UXLibs8
cassininazir
1
340
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
390
A Tale of Four Properties
chriscoyier
163
24k
Building an army of robots
kneath
306
46k
Building the Perfect Custom Keyboard
takai
2
780
Docker and Python
trallard
47
3.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
エンジニアに許された特別な時間の終わり
watany
107
240k
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!