Store#clear to return self
* src/store/MemoryStore.js (clear): Promise resolve to self. * src/store/Store.js (clear): Update docblock. * test/store/MemoryStoreTest.js: Update test case accordingly. DEV-2296master
parent
b62673791b
commit
282c0acf54
|
@ -111,13 +111,14 @@ module.exports = Class( 'MemoryStore' )
|
|||
/**
|
||||
* Clear all items in store
|
||||
*
|
||||
* @return {Promise} promise to clear store
|
||||
* @return {Promise<Store>} promise to clear store, resolving to self
|
||||
* (for chaining)
|
||||
*/
|
||||
'virtual public clear': function()
|
||||
{
|
||||
this._store = {};
|
||||
|
||||
return Promise.resolve( true );
|
||||
return Promise.resolve( this.__inst );
|
||||
},
|
||||
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@ module.exports = Interface( 'Store',
|
|||
/**
|
||||
* Clear all items in store
|
||||
*
|
||||
* @return {Promise} promise to clear store
|
||||
* @return {Promise<Store>} promise to clear store, resolving to self
|
||||
* (for chaining)
|
||||
*/
|
||||
'public clear': [],
|
||||
|
||||
|
|
|
@ -103,6 +103,16 @@ describe( 'store.MemoryStore', () =>
|
|||
);
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
it( 'returns self with promise', () =>
|
||||
{
|
||||
const sut = Sut();
|
||||
|
||||
return expect(
|
||||
sut.clear()
|
||||
).to.eventually.equal( sut );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue