@@ -147,22 +147,6 @@ describe('Actions', () => {
147
147
expect ( ( ) => store . throws ( ) ) . toThrowError ( 'fail' )
148
148
} )
149
149
150
- it . skip ( 'can avoid thrown errors to propagate' , ( ) => {
151
- const store = useStore ( )
152
- store . $onAction ( ( { onError } ) => {
153
- onError ( ( ) => false )
154
- } )
155
- expect ( ( ) => store . throws ( ) ) . not . toThrowError ( 'fail' )
156
- } )
157
-
158
- it . skip ( 'can avoid async errors to propagate' , async ( ) => {
159
- const store = useStore ( )
160
- store . $onAction ( ( { onError } ) => {
161
- onError ( ( ) => false )
162
- } )
163
- await expect ( store . rejects ( ) ) . resolves . toBe ( undefined )
164
- } )
165
-
166
150
it ( 'throws async errors' , async ( ) => {
167
151
const store = useStore ( )
168
152
expect . assertions ( 1 )
@@ -178,45 +162,6 @@ describe('Actions', () => {
178
162
expect ( spy ) . toHaveBeenCalledWith ( 'fail' )
179
163
} )
180
164
181
- it . skip ( 'can override the returned value' , ( ) => {
182
- const store = useStore ( )
183
- expect . assertions ( 2 )
184
- store . $onAction ( ( { after } ) => {
185
- // @ts -expect-error: cannot return a string because no action returns a string
186
- after ( ( v ) => {
187
- expect ( v ) . toBe ( false )
188
- return 'hello'
189
- } )
190
- } )
191
- expect ( store . toggle ( ) ) . toBe ( 'hello' )
192
- } )
193
-
194
- it . skip ( 'can override the resolved value' , async ( ) => {
195
- const store = useStore ( )
196
- expect . assertions ( 2 )
197
- store . $onAction ( ( { after } ) => {
198
- // @ts -expect-error: cannot return a string because no action returns a string
199
- after ( ( v ) => {
200
- expect ( v ) . toBe ( false )
201
- return 'hello'
202
- } )
203
- } )
204
- await expect ( store . getNonA ( ) ) . resolves . toBe ( 'hello' )
205
- } )
206
-
207
- it . skip ( 'can override the resolved value with a promise' , async ( ) => {
208
- const store = useStore ( )
209
- expect . assertions ( 2 )
210
- store . $onAction ( ( { after } ) => {
211
- // @ts -expect-error: cannot return a string because no action returns a string
212
- after ( async ( v ) => {
213
- expect ( v ) . toBe ( false )
214
- return 'hello'
215
- } )
216
- } )
217
- await expect ( store . getNonA ( ) ) . resolves . toBe ( 'hello' )
218
- } )
219
-
220
165
it ( 'can destructure actions' , ( ) => {
221
166
const store = useStore ( )
222
167
const { simple } = store
0 commit comments