浏览代码

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

Fela Maslen 5 年之前
父节点
当前提交
d6a1b157ea
共有 1 个文件被更改,包括 2 次插入3 次删除
  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(() => {