Completed unit tests for when and promise libraries.