✨ Simplify arrow function syntax in unit test
This commit is contained in:
@@ -164,7 +164,7 @@ describe('useAsyncState', () => {
|
|||||||
|
|
||||||
it('should cancel ongoing operation when reset', async () => {
|
it('should cancel ongoing operation when reset', async () => {
|
||||||
const { execute, reset, loading } = useAsyncState();
|
const { execute, reset, loading } = useAsyncState();
|
||||||
const asyncFn = vi.fn(async (signal) => {
|
const asyncFn = vi.fn(async signal => {
|
||||||
await new Promise(resolve => setTimeout(resolve, 100));
|
await new Promise(resolve => setTimeout(resolve, 100));
|
||||||
if (signal?.aborted) throw new Error('Aborted');
|
if (signal?.aborted) throw new Error('Aborted');
|
||||||
return 'Success';
|
return 'Success';
|
||||||
|
|||||||
Reference in New Issue
Block a user