File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -840,6 +840,23 @@ describe('store: [adapter=DOMAIN]', () => {
840840 } ) ;
841841 } ) ;
842842
843+ it ( 'should return the response from callback function.' , ( done ) => {
844+ const callback = ( ) => {
845+ globalStore . set ( { foo : 'foo' } ) ;
846+
847+ return functionAccessingStore ( ) ;
848+ } ;
849+
850+ const functionAccessingStore = ( ) => {
851+ return globalStore . get ( 'foo' ) ;
852+ } ;
853+
854+ const response = globalStore . initialize ( adapter ) ( callback ) ;
855+ expect ( response ) . to . equal ( 'foo' ) ;
856+
857+ done ( ) ;
858+ } ) ;
859+
843860 it ( 'should return the response from async callback function.' , async ( ) => {
844861 const callback = async ( ) => {
845862 globalStore . set ( { foo : 'foo' } ) ;
@@ -872,9 +889,9 @@ describe('store: [adapter=DOMAIN]', () => {
872889 const callback = ( ) => {
873890 globalStore . set ( { foo : 'foo' } ) ;
874891
875- return new Promise ( ( resolve , rejects ) => {
892+ return new Promise ( ( resolve , reject ) => {
876893 setTimeout ( ( ) => {
877- rejects ( 'Hello world' ) ;
894+ reject ( 'Hello world' ) ;
878895 } , 1 ) ;
879896 } ) ;
880897 } ;
You can’t perform that action at this time.
0 commit comments