From b88413892394e51b565e9e536bf2e7c93298deb0 Mon Sep 17 00:00:00 2001 From: Simon Ho Date: Fri, 2 Sep 2016 13:53:07 -0700 Subject: [PATCH] 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. --- test/kvao/expire.suite.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/kvao/expire.suite.js b/test/kvao/expire.suite.js index 0d84f027..9bb2f800 100644 --- a/test/kvao/expire.suite.js +++ b/test/kvao/expire.suite.js @@ -36,7 +36,8 @@ module.exports = function(dataSourceFactory, connectorCapabilities) { }); 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() { throw new Error('expire() should have failed'); },