Explorar o código

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

Fela Maslen %!s(int64=5) %!d(string=hai) anos
pai
achega
d6a1b157ea
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  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', () => {
     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 () => {
       it('should set the loading state back to false and not set the response', async () => {
-        expect.assertions(4);
-
         const { getByText, getByTestId, unmount } = setupRequest();
         const { getByText, getByTestId, unmount } = setupRequest();
         act(() => {
         act(() => {
           fireEvent.click(getByText('Cancel!'));
           fireEvent.click(getByText('Cancel!'));
@@ -110,8 +109,8 @@ describe(useRequestCallback.name, () => {
       onError.mockClear();
       onError.mockClear();
     });
     });
 
 
+    // eslint-disable-next-line jest/prefer-expect-assertions
     it('should call onError', async () => {
     it('should call onError', async () => {
-      expect.assertions(3);
       const { unmount } = setupRequest();
       const { unmount } = setupRequest();
 
 
       await waitFor(() => {
       await waitFor(() => {