Jelajahi Sumber

fix: removed all expect assertions on tests with waitFor()

Fela Maslen 5 tahun lalu
induk
melakukan
d6a1b157ea
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      gmus-web/src/hooks/request.spec.tsx

+ 2 - 3
gmus-web/src/hooks/request.spec.tsx

@@ -80,9 +80,8 @@ describe(useRequestCallback.name, () => {
     });
 
     describe('when the request is cancelled', () => {
+      // eslint-disable-next-line jest/prefer-expect-assertions
       it('should set the loading state back to false and not set the response', async () => {
-        expect.assertions(4);
-
         const { getByText, getByTestId, unmount } = setupRequest();
         act(() => {
           fireEvent.click(getByText('Cancel!'));
@@ -110,8 +109,8 @@ describe(useRequestCallback.name, () => {
       onError.mockClear();
     });
 
+    // eslint-disable-next-line jest/prefer-expect-assertions
     it('should call onError', async () => {
-      expect.assertions(3);
       const { unmount } = setupRequest();
 
       await waitFor(() => {