Upload
henrique-luz
View
209
Download
0
Embed Size (px)
Citation preview
Testando Componentes 3D
Henrique Luz
Agenda Testes: Abordagem tradicional
Como testar componentes 3D?
Overview Jasmine
Demo
Conclusões
Perguntas
o que temos hoje
testes unitários + integração:
testes de aceitação/funcionais:
- serverside: JUnit, DBUnit, etc.
- Selenium + Cucumber/JBehave
componentes 3D
onde encaixar?
unitários? aceitação?
canvas inacessível
ThreeJS é JavaScript!
alternativa
teste seus componentes JS
<3
syntax clean independente de outros FW não necessita do DOM
Jasmine
specsdefinem os testes
describe
it
descrição de cenários
contém um ou mais expectations
matchers toBe not toEqual toMatch toBeDefined/toBeUndefined toBeNull
toBeTrutht/toBeFalsy toContain toBeLessThan toBeGreaterThan toBeClose toThrow
avaliam o comportamento da feature por cenário
são customizáveis
matchers
setup / teardown beforeEach/afterEach beforeAll/afterAll
evitam duplicação
DRY
spies
#parecemasnaoe
spiesspyOn
toHaveBeenCalled
toHaveBeenCalledWith
and
callThrough
returnValue
callFake
throwError
spies
spiescalls
any count mostRecent first
contexto 3d
#comofas?
demo
cobertura Karma – http://karma-runner.github.io/ Istanbul –
http://gotwarlost.github.io/istanbul Blanket.JS – http://blanketjs.org
resumo crie testes mock as dependências refatore cubra seu código! melhor design
perguntas?