cferdinandi/smooth-scroll — pull request #128 by ThibWeb (2014-12-13 11:54:42+00:00)
Title: Add some unit testing

Hey there,

I've been using this library for quite some time so I decided to try to contribute a little bit, and wrote some unit tests (because #109).

![testcases-screenshot](https://cloud.githubusercontent.com/assets/877585/5423582/8aed415e-8329-11e4-8efa-33c1dd8e9653.png)

Coverage before:

Statements: 14.67% (22 / 150)

Branches: 4.65% (6 / 129)

Functions: 9.09% (2 / 22)

Lines: 16.18% (22 / 136)

Ignored: none

Coverage after:

Statements: 81.33% (122 / 150)

Branches: 56.59% (73 / 129)

Functions: 100% (22 / 22)

Lines: 88.24% (120 / 136)

Ignored: none

As for a sleek 100% coverage, IMHO it would require the script's internals to be exposed somehow. Worth the pain, I don't know.