The document is an agenda for a presentation on JavaScript testing. The summary includes:
1) The presentation covers JavaScript testing fundamentals including the importance of testing, different testing frameworks, unit vs integration testing, and tools to assist with testing.
2) Testing JavaScript applications is important because JavaScript is widely used but many developers do not fully understand it. Writing tests encourages writing code in a testable way and prevents bugs.
3) The presentation concludes by thanking the audience and providing contact details for the presenter.
3. Any application that can be
written in JavaScript, will be
written in JavaScript
-- Atwood’s
Law
JS is everywhere
4. That no one thinks they need to
actually learn how it works.
Looks like C or Java… How
hard could it be?
JavaScript is so
approachable
5. ? The old way
? Frameworks
? The lies
? Where to start
? Tooling
? Who knows?
The Agenda
6. “Whenever you are tempted to
type something into a print
statement or a debugger
expression, write it as a test
instead.”
—Martin Fowler
When do I write a test?
8. ?A unit test is code that executes
part of your production code
with an expectation on the
result.
?Unit vs. Integration
?Mocking & Stubbing
?Vocabulary
Who am I
Envoc
.Net beginning
now they pay me to write JavaScript
The web is changing rapidly
The good old days
WEB FORMS:
post a form
let the server build 1/2 MB or html
and then send it back to the client
to change a radio button …
Cue magic
Some of you may still live there...
Get out now…
JavaScript on rise
Atwood’s Law
CodingHorror
StackOverflow
it runs everywhere
The server
Mobile apps
TVs?
PS4?
Heard of the web.. it is here to stay.
0.1 + 0.2
console.log
has the nasty risk of introducing bugs all on its own.
enter dev tools (`debugger;`)
QUnit
older, more support
mocha
can drop in any* assertion library
jasmine
headless browser support
built in spies & mocks
Vocabulary
A unit test is code that executes part of your production code with an expectation on the result.
Unit vs integration
unit - should be able to trust they should all be green
integration - sometimes fail due to circumstance/environment
Mocking and stubbing
Mocks - you expect to assert against value (1 per test)
Stubs - fake calls out. can have many
----- Meeting Notes (4/8/14 20:43) -----
Gmail, Facebook, Twitter, Azure Management Portal
Models, Controllers, Services, Smart Caching, DI
-- All things that can live in the client now
----- Meeting Notes (4/8/14 20:48) -----
Most of the tooling you will find will run on NodeJS
Node has made Windows a first class citizen.
You can integrate it into most of your existing CI servers.
The only thing stopping you is you.
This is not library code.
There is very little DOM manipulation going on here (SPA).
This is application logic.