Fix test case for expire

Forwardport of #1074. #1072 was missing Promise.resolve before using
delay(20) and causing Travis to fail on 2.x. This PR makes the test code
consistent on both master and 2.x.
This commit is contained in:
Simon Ho 2016-09-02 13:53:07 -07:00
parent 68294babdb
commit b884138923
1 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,8 @@ module.exports = function(dataSourceFactory, connectorCapabilities) {
}); });
it('returns error when expiring a key that has expired', function() { it('returns error when expiring a key that has expired', function() {
return CacheItem.set('expired-key', 'a-value', 1).delay(20) return Promise.resolve(CacheItem.set('expired-key', 'a-value', 1))
.delay(20)
.then(function() { return CacheItem.expire('expired-key', 1000); }) .then(function() { return CacheItem.expire('expired-key', 1000); })
.then( .then(
function() { throw new Error('expire() should have failed'); }, function() { throw new Error('expire() should have failed'); },