Add functionPromise unit tests