test your javascript! v1.1

Post on 21-Oct-2014

10.886 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Introduction to unit/functional testing and continuous integration with JavaScript

TRANSCRIPT

Testing JavaScript

© 2013 Eric Wendelin@eriwen

Eric Wendelin

Blog: eriwen.com

Twitter: @eriwen

Code: git.io/eric

Today, we’ll talk about

• What makes JS testing hard

• A few ways we can make our JS more testable

• Some tools that make testing easier

Why is testing your JavaScript important?

The community is behind in testing

Why is JavaScript so hard to test?

Un-testable JS is most of the problem

Don’t do this!

Do this!

Use with caution!

Better!

Don’t do this!

Do this!

Don’t do this!

Do this!

Don’t do this!

Do this!

Writing Tests

1 unit test framework +1 functional test framework

= Infinite Pocket Bacon

Logic / Computation

unit test

Computation Example

User Interaction

functional test

Interaction Example

sinon.js goodies• Jasmine Adapter

• QUnit Adapter

• Mocha Adapter

• Buster.js Adapter

• Chai-specific matchers

• Jasmine matchers

• ... much more

ember-testing

/ember.js/packages/ember-testing

{F*** IT! WE’LL DO IT LIVE!}

culture of testing

top related