Add unit tests.

assert.deepEqual(applicationError, error);
done();

If done is not called, test will fail.