@@ -39,7 +39,11 @@ describe('configureStore', async () => {
39
39
expect . any ( Function ) ,
40
40
)
41
41
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
+ }
43
47
} )
44
48
} )
45
49
@@ -53,7 +57,11 @@ describe('configureStore', async () => {
53
57
expect ( configureStore ( { reducer } ) ) . toBeInstanceOf ( Object )
54
58
expect ( redux . combineReducers ) . toHaveBeenCalledWith ( reducer )
55
59
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
+ }
57
65
expect ( redux . createStore ) . toHaveBeenCalledWith (
58
66
expect . any ( Function ) ,
59
67
undefined ,
@@ -76,7 +84,11 @@ describe('configureStore', async () => {
76
84
configureStore ( { middleware : ( ) => new Tuple ( ) , reducer } ) ,
77
85
) . toBeInstanceOf ( Object )
78
86
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
+ }
80
92
expect ( redux . createStore ) . toHaveBeenCalledWith (
81
93
reducer ,
82
94
undefined ,
@@ -105,7 +117,11 @@ describe('configureStore', async () => {
105
117
expect . any ( Function ) , // serializableCheck
106
118
expect . any ( Function ) , // actionCreatorCheck
107
119
)
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
+ }
109
125
expect ( redux . createStore ) . toHaveBeenCalledWith (
110
126
reducer ,
111
127
undefined ,
@@ -142,7 +158,11 @@ describe('configureStore', async () => {
142
158
configureStore ( { middleware : ( ) => new Tuple ( thank ) , reducer } ) ,
143
159
) . toBeInstanceOf ( Object )
144
160
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
+ }
146
166
expect ( redux . createStore ) . toHaveBeenCalledWith (
147
167
reducer ,
148
168
undefined ,
@@ -197,7 +217,13 @@ describe('configureStore', async () => {
197
217
Object ,
198
218
)
199
219
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
+ }
201
227
expect ( redux . createStore ) . toHaveBeenCalledWith (
202
228
reducer ,
203
229
undefined ,
@@ -210,7 +236,11 @@ describe('configureStore', async () => {
210
236
it ( 'calls createStore with preloadedState' , ( ) => {
211
237
expect ( configureStore ( { reducer } ) ) . toBeInstanceOf ( Object )
212
238
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
+ }
214
244
expect ( redux . createStore ) . toHaveBeenCalledWith (
215
245
reducer ,
216
246
undefined ,
@@ -241,7 +271,11 @@ describe('configureStore', async () => {
241
271
} ) ,
242
272
) . toBeInstanceOf ( Object )
243
273
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
+ }
245
279
expect ( redux . createStore ) . toHaveBeenCalledWith (
246
280
reducer ,
247
281
undefined ,
0 commit comments