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
Ecossistema de Testes com JavaScript
Search
Jonathan Cruz Rocha Ferreira
May 09, 2019
Programming
0
71
Ecossistema de Testes com JavaScript
Ecossistema de Testes com JavaScript
Jonathan Cruz Rocha Ferreira
May 09, 2019
Tweet
Share
More Decks by Jonathan Cruz Rocha Ferreira
See All by Jonathan Cruz Rocha Ferreira
Automatizando Release
joohncruz
0
10
Design System com StencilJs - 17 de fev. de 2020
joohncruz
0
13
Introducao React Apps
joohncruz
0
10
Engatinhando_com_Redux_Saga.pdf
joohncruz
0
18
Arquitetura React Projeto Base
joohncruz
0
56
Testes Unitários em React
joohncruz
0
58
Apresentando o VueJs
joohncruz
0
12
Testes Unitários em App React
joohncruz
0
16
Other Decks in Programming
See All in Programming
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
6.5k
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
5.7k
AIを活用したレシート読み取り機能の開発から得られた実践知 / AI Receipt Scan Practice
rockname
2
890
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osk2025-duckdb
takahashiikki
1
210
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
910
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
チームのテスト力を鍛える
goyoki
3
1.1k
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
820
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
820
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
3
1.1k
LLMとPlaywright/reg-suitを活用した jQueryリファクタリングの実際
kinocoboy2
4
470
Navigating Dependency Injection with Metro
zacsweers
3
5.7k
Featured
See All Featured
Code Review Best Practice
trishagee
71
19k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Building Applications with DynamoDB
mza
96
6.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How to Think Like a Performance Engineer
csswizardry
27
2k
Practical Orchestrator
shlominoach
190
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Into the Great Unknown - MozCon
thekraken
40
2k
How to Ace a Technical Interview
jacobian
280
23k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Done Done
chrislema
185
16k
Transcript
Ecossistema de Testes com JavaScript Jonathan Cruz Github: joohncruz Artur
Quirino Github ArturQuirino
“Por que não devemos testar nossa aplicação?” https://www.quora.com/Would-you-work-for-a-company-who-doesnt-write-tests/answer/Tim-Moore-2? srid=OBCN
Testes Automatizados Mike Cohn https://www.mountaingoatsoftware.com/blog/the-forgotten-layer-of-the-test-automation-pyramid
None
Tipos de testes https://willianjusten.com.br/entendendo-testes-de-software/ • Teste de Unidade • Teste
de Integração/Service • Teste de UI/e2e • etc
Testes Unitários O teste unitário tem por objetivo testar a
menor parte testável do sistema (unidade), em geral, um método. Idealmente, o teste unitário é independente de outros testes, validando assim cada parte ou funcionalidade individualmente.
Respondendo algumas perguntas O que eu estou testando? O que
o método deveria fazer? Qual o seu atual retorno? O que eu espero que retorne?
None
Ferramentas existem poucas MochaJS Jasmine Jest Cucumber Chai Unexpected Karma
Ava Sinon Enzyme Testdouble Istanbul Blanket Protractor PhantomJS Casper Nightwatch Cypress.io
Estrutura de testes Mocha, Jasmine, Jest e Cucumber // 1
- beforeAll // 1 - beforeEach // 1 - test // 1 - afterEach // 2 - beforeAll // 1 - beforeEach // 2 - beforeEach // 2 - test // 2 - afterEach // 1 - afterEach // 2 - afterAll // 1 - afterAll
Funções de Validação, asserts Chai, Jasmine, Jest e Unexpected .toBeNull()
.toBeTruthy() .toBeUndefined() .toContain(item) .toEqual(value) .toHaveLength(int) .toBe() https://jestjs.io/docs/en/expect.html
Display e Watch dos resultados Mocha, Jasmine, Jest e Karma
Snapshot Jest, Ava
Mocks, Spies e Stubs Sinon, Jasmine, enzyme, jest e testdouble
https://medium.com/@rickhanlonii/understanding-jest-mocks-f0046c68e53c
Cobertura de código Istanbul, Jest e Blanket https://jestjs.io/docs/en/configuration
Cobertura de código - reports Istanbul, Jest e Blanket https://jestjs.io/docs/en/configuration
None
“Jest apareceu 5x em 6” sim eu contei https://jestjs.io/ FACEBOOK
Navegador ou Ambiente Protractor, webdriver, nightwatch, phantom e casper https://frontendmasters.com/books/front-e
nd-handbook/2019/
Cypress.io https://www.cypress.io/features/
Cypress.io https://github.com/joohncruz/todo-list-rea ct-cypress
VALEU!