function lifecycleTest (store, t) {
  P.promisifyAll(store);

  return redisSrv.connect()
    .then(function () {
      return store.setAsync('123', { cookie: { maxAge: 2000 }, name: 'tj' });
    })
    .then(function (ok) {
      t.equal(ok, 'OK', '#set() ok');
      return store.getAsync('123');
    })
    .then(function (data) {
      t.deepEqual({ cookie: { maxAge: 2000 }, name: 'tj' }, data, '#get() ok');
    })
    .then(function () {
      return store.setAsync('123', { cookie: { maxAge: undefined }, name: 'tj' });
    })
    .then(function (ok) {
      t.equal(ok, 'OK', '#set() no maxAge ok');
      return store.destroyAsync('123');
    })
    .then(function (ok) {
      t.equal(ok, 1, '#destroy() ok');
      store.client.end();
      return redisSrv.disconnect();
    });
}
// Takes a store through all the operations
Takes a store through all the operations
Takes a store through all the operations
function lifecycleTest (store, t) {
  P.promisifyAll(store);
  return redisSrv.connect()
    .then(function () {
      return store.setAsync('123', { cookie: { maxAge: 2000 }, name: 'tj' });
    })
    .then(function (ok) {
      t.equal(ok, 'OK', '#set() ok');
      return store.getAsync('123');
    })
    .then(function (data) {
      t.deepEqual({ cookie: { maxAge: 2000 }, name: 'tj' }, data, '#get() ok');
    })
    .then(function () {
      return store.setAsync('123', { cookie: { maxAge: undefined }, name: 'tj' });
    })
    .then(function (ok) {
      t.equal(ok, 'OK', '#set() no maxAge ok');
      return store.destroyAsync('123');
    })
    .then(function (ok) {
      t.equal(ok, 1, '#destroy() ok');
      store.client.end();
      return redisSrv.disconnect();
    });
}
function lifecycleTest ( store , t ) { P . promisifyAll ( store ) ; return redisSrv . connect ( ) . then ( function ( ) { return store . setAsync ( '123' , { cookie : { maxAge : 2000 } , name : 'tj' } ) ; } ) . then ( function ( ok ) { t . equal ( ok , 'OK' , '#set() ok' ) ; return store . getAsync ( '123' ) ; } ) . then ( function ( data ) { t . deepEqual ( { cookie : { maxAge : 2000 } , name : 'tj' } , data , '#get() ok' ) ; } ) . then ( function ( ) { return store . setAsync ( '123' , { cookie : { maxAge : undefined } , name : 'tj' } ) ; } ) . then ( function ( ok ) { t . equal ( ok , 'OK' , '#set() no maxAge ok' ) ; return store . destroyAsync ( '123' ) ; } ) . then ( function ( ok ) { t . equal ( ok , 1 , '#destroy() ok' ) ; store . client . end ( ) ; return redisSrv . disconnect ( ) ; } ) ; }
Takes a store through all the operations
Takes a store through all the operations