[Bug 871581] Added unit testing with mocha

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=871581