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
0
28
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
79
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
stefanteixeira
0
110
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
63
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
48
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
42
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
120
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
80
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
68
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
59
Other Decks in Programming
See All in Programming
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
240
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
360
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
350
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
260
rails newと同時に型を書く
aki19035vc
5
620
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
200
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
350
php-conference-japan-2024
tasuku43
0
410
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
1.1k
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
210
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
280
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Navigating Team Friction
lara
183
15k
BBQ
matthewcrist
85
9.4k
KATA
mclloyd
29
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
How to train your dragon (web standard)
notwaldorf
88
5.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
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!