@@ -39,7 +39,11 @@ describe('configureStore', async () => {
3939 expect . any ( Function ) ,
4040 )
4141 expect ( redux . applyMiddleware ) . toHaveBeenCalled ( )
42- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
42+ if ( process . env . TEST_DIST ) {
43+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
44+ } else {
45+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledTimes ( 2 )
46+ }
4347 } )
4448 } )
4549
@@ -53,7 +57,11 @@ describe('configureStore', async () => {
5357 expect ( configureStore ( { reducer } ) ) . toBeInstanceOf ( Object )
5458 expect ( redux . combineReducers ) . toHaveBeenCalledWith ( reducer )
5559 expect ( redux . applyMiddleware ) . toHaveBeenCalled ( )
56- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
60+ if ( process . env . TEST_DIST ) {
61+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
62+ } else {
63+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
64+ }
5765 expect ( redux . createStore ) . toHaveBeenCalledWith (
5866 expect . any ( Function ) ,
5967 undefined ,
@@ -76,7 +84,11 @@ describe('configureStore', async () => {
7684 configureStore ( { middleware : ( ) => new Tuple ( ) , reducer } ) ,
7785 ) . toBeInstanceOf ( Object )
7886 expect ( redux . applyMiddleware ) . toHaveBeenCalledWith ( )
79- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
87+ if ( process . env . TEST_DIST ) {
88+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
89+ } else {
90+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
91+ }
8092 expect ( redux . createStore ) . toHaveBeenCalledWith (
8193 reducer ,
8294 undefined ,
@@ -105,7 +117,11 @@ describe('configureStore', async () => {
105117 expect . any ( Function ) , // serializableCheck
106118 expect . any ( Function ) , // actionCreatorCheck
107119 )
108- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
120+ if ( process . env . TEST_DIST ) {
121+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
122+ } else {
123+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
124+ }
109125 expect ( redux . createStore ) . toHaveBeenCalledWith (
110126 reducer ,
111127 undefined ,
@@ -142,7 +158,11 @@ describe('configureStore', async () => {
142158 configureStore ( { middleware : ( ) => new Tuple ( thank ) , reducer } ) ,
143159 ) . toBeInstanceOf ( Object )
144160 expect ( redux . applyMiddleware ) . toHaveBeenCalledWith ( thank )
145- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
161+ if ( process . env . TEST_DIST ) {
162+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
163+ } else {
164+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
165+ }
146166 expect ( redux . createStore ) . toHaveBeenCalledWith (
147167 reducer ,
148168 undefined ,
@@ -197,7 +217,13 @@ describe('configureStore', async () => {
197217 Object ,
198218 )
199219 expect ( redux . applyMiddleware ) . toHaveBeenCalled ( )
200- expect ( composeWithDevToolsSpy ) . toHaveBeenCalledWith ( options ) // @remap -prod-remove-line
220+ if ( process . env . TEST_DIST ) {
221+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
222+ } else {
223+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
224+
225+ expect ( composeWithDevToolsSpy ) . toHaveBeenLastCalledWith ( options )
226+ }
201227 expect ( redux . createStore ) . toHaveBeenCalledWith (
202228 reducer ,
203229 undefined ,
@@ -210,7 +236,11 @@ describe('configureStore', async () => {
210236 it ( 'calls createStore with preloadedState' , ( ) => {
211237 expect ( configureStore ( { reducer } ) ) . toBeInstanceOf ( Object )
212238 expect ( redux . applyMiddleware ) . toHaveBeenCalled ( )
213- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
239+ if ( process . env . TEST_DIST ) {
240+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
241+ } else {
242+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
243+ }
214244 expect ( redux . createStore ) . toHaveBeenCalledWith (
215245 reducer ,
216246 undefined ,
@@ -241,7 +271,11 @@ describe('configureStore', async () => {
241271 } ) ,
242272 ) . toBeInstanceOf ( Object )
243273 expect ( redux . applyMiddleware ) . toHaveBeenCalled ( )
244- expect ( composeWithDevToolsSpy ) . toHaveBeenCalled ( ) // @remap -prod-remove-line
274+ if ( process . env . TEST_DIST ) {
275+ expect ( composeWithDevToolsSpy ) . not . toHaveBeenCalled ( )
276+ } else {
277+ expect ( composeWithDevToolsSpy ) . toHaveBeenCalledOnce ( )
278+ }
245279 expect ( redux . createStore ) . toHaveBeenCalledWith (
246280 reducer ,
247281 undefined ,
0 commit comments