Просмотр исходного кода

chore(js): Remove unnecessary 'async' in tests (#35291)

Evan Purkhiser 2 лет назад
Родитель
Сommit
db19e95171

+ 1 - 1
tests/js/spec/actionCreators/committers.spec.jsx

@@ -82,7 +82,7 @@ describe('CommitterActionCreator', function () {
     });
   });
 
-  it('short-circuits the JS event loop', async () => {
+  it('short-circuits the JS event loop', () => {
     expect(CommitterStore.state.committersLoading).toEqual(undefined);
 
     getCommitters(api, {

+ 1 - 1
tests/js/spec/actionCreators/events.spec.jsx

@@ -68,7 +68,7 @@ describe('Events ActionCreator', function () {
     );
   });
 
-  it('requests events stats with absolute period', async function () {
+  it('requests events stats with absolute period', function () {
     const start = new Date('2017-10-12T12:00:00.000Z');
     const end = new Date('2017-10-17T00:00:00.000Z');
     doEventsRequest(api, {

+ 2 - 2
tests/js/spec/actionCreators/release.spec.jsx

@@ -58,7 +58,7 @@ describe('ReleaseActionCreator', function () {
       expect(ReleaseStore.state.releaseError[releaseKey]).toEqual(undefined);
     });
 
-    it('short-circuits the JS event loop when fetching Release', async () => {
+    it('short-circuits the JS event loop when fetching Release', () => {
       expect(ReleaseStore.state.releaseLoading[releaseKey]).toEqual(undefined);
 
       getProjectRelease(api, {orgSlug, projectSlug, releaseVersion});
@@ -111,7 +111,7 @@ describe('ReleaseActionCreator', function () {
       expect(ReleaseStore.state.deploysError[releaseKey]).toEqual(undefined);
     });
 
-    it('short-circuits the JS event loop when fetching Deploys', async () => {
+    it('short-circuits the JS event loop when fetching Deploys', () => {
       expect(ReleaseStore.state.deploysLoading[releaseKey]).toEqual(undefined);
 
       getReleaseDeploys(api, {orgSlug, projectSlug, releaseVersion});

+ 1 - 1
tests/js/spec/actionCreators/repositories.spec.jsx

@@ -54,7 +54,7 @@ describe('RepositoryActionCreator', function () {
     expect(RepositoryStore.state.repositoriesLoading).toEqual(false);
   });
 
-  it('short-circuits the JS event loop', async () => {
+  it('short-circuits the JS event loop', () => {
     expect(RepositoryStore.state.repositoriesLoading).toEqual(undefined);
 
     getRepositories(api, {orgSlug}); // Fire Action.loadRepositories

+ 4 - 4
tests/js/spec/components/assigneeSelector.spec.jsx

@@ -112,7 +112,7 @@ describe('AssigneeSelector', function () {
   });
 
   describe('render with props', function () {
-    it('renders members from the prop when present', async function () {
+    it('renders members from the prop when present', function () {
       assigneeSelector = mountWithTheme(
         <AssigneeSelectorComponent id={GROUP_1.id} memberList={[USER_2, USER_3]} />
       );
@@ -159,7 +159,7 @@ describe('AssigneeSelector', function () {
     expect(assigneeSelector.find('LoadingIndicator')).toHaveLength(1);
   });
 
-  it('does not have loading state and shows member list after calling MemberListStore.loadInitialData', async function () {
+  it('does not have loading state and shows member list after calling MemberListStore.loadInitialData', function () {
     openMenu();
     MemberListStore.loadInitialData([USER_1, USER_2]);
     assigneeSelector.update();
@@ -274,7 +274,7 @@ describe('AssigneeSelector', function () {
     );
   });
 
-  it('shows invite member button', async function () {
+  it('shows invite member button', function () {
     jest.spyOn(ConfigStore, 'get').mockImplementation(() => true);
 
     openMenu();
@@ -360,7 +360,7 @@ describe('AssigneeSelector', function () {
     );
   });
 
-  it('renders unassigned', async function () {
+  it('renders unassigned', function () {
     jest.spyOn(GroupStore, 'get').mockImplementation(() => GROUP_2);
     assigneeSelector = mountWithTheme(<AssigneeSelectorComponent id={GROUP_2.id} />);
     const avatarTooltip = mountWithTheme(assigneeSelector.find('Tooltip').prop('title'));

+ 1 - 1
tests/js/spec/components/assistant/guideAnchor.spec.jsx

@@ -113,7 +113,7 @@ describe('GuideAnchor', function () {
     expect(screen.getByTestId('child-div')).toBeInTheDocument();
   });
 
-  it('renders children when disabled', async function () {
+  it('renders children when disabled', function () {
     render(
       <GuideAnchor disabled target="exception">
         <div data-test-id="child-div" />

+ 3 - 3
tests/js/spec/components/charts/eventsRequest.spec.jsx

@@ -38,7 +38,7 @@ describe('EventsRequest', function () {
       wrapper = mountWithTheme(<EventsRequest {...DEFAULTS}>{mock}</EventsRequest>);
     });
 
-    it('makes requests', async function () {
+    it('makes requests', function () {
       expect(mock).toHaveBeenNthCalledWith(
         1,
         expect.objectContaining({
@@ -574,7 +574,7 @@ describe('EventsRequest', function () {
       doEventsRequest.mockClear();
     });
 
-    it('does not make request', async function () {
+    it('does not make request', function () {
       wrapper = mountWithTheme(
         <EventsRequest {...DEFAULTS} expired>
           {mock}
@@ -583,7 +583,7 @@ describe('EventsRequest', function () {
       expect(doEventsRequest).not.toHaveBeenCalled();
     });
 
-    it('errors', async function () {
+    it('errors', function () {
       wrapper = mountWithTheme(
         <EventsRequest {...DEFAULTS} expired>
           {mock}

+ 6 - 6
tests/js/spec/components/createAlertButton.spec.jsx

@@ -180,7 +180,7 @@ describe('CreateAlertFromViewButton', () => {
     expect(onCloseMock).toHaveBeenCalledTimes(1);
   });
 
-  it('disables the create alert button for members', async () => {
+  it('disables the create alert button for members', () => {
     const eventView = EventView.fromSavedQuery({
       ...DEFAULT_EVENT_VIEW,
     });
@@ -195,7 +195,7 @@ describe('CreateAlertFromViewButton', () => {
     expect(button.props()['aria-disabled']).toBe(true);
   });
 
-  it('shows a guide for members', async () => {
+  it('shows a guide for members', () => {
     const noAccessOrg = {
       ...organization,
       access: [],
@@ -209,7 +209,7 @@ describe('CreateAlertFromViewButton', () => {
     expect(guide.props().target).toBe('alerts_write_member');
   });
 
-  it('shows a guide for owners/admins', async () => {
+  it('shows a guide for owners/admins', () => {
     const adminAccessOrg = {
       ...organization,
       access: ['org:write'],
@@ -224,7 +224,7 @@ describe('CreateAlertFromViewButton', () => {
     expect(guide.props().onFinish).toBeDefined();
   });
 
-  it('redirects to alert wizard with no project', async () => {
+  it('redirects to alert wizard with no project', () => {
     jest.spyOn(navigation, 'navigateTo');
 
     const wrapper = generateWrappedComponentButton(organization);
@@ -235,7 +235,7 @@ describe('CreateAlertFromViewButton', () => {
     );
   });
 
-  it('redirects to alert wizard with a project', async () => {
+  it('redirects to alert wizard with a project', () => {
     const wrapper = generateWrappedComponentButton(organization, {
       projectSlug: 'proj-slug',
     });
@@ -245,7 +245,7 @@ describe('CreateAlertFromViewButton', () => {
     );
   });
 
-  it('removes a duplicate project filter', async () => {
+  it('removes a duplicate project filter', () => {
     const eventView = EventView.fromSavedQuery({
       ...DEFAULT_EVENT_VIEW,
       query: 'event.type:error project:project-slug',

+ 1 - 1
tests/js/spec/components/events/eventVitals.spec.jsx

@@ -46,7 +46,7 @@ describe('EventVitals', function () {
     expect(wrapper.find('EventVital')).toHaveLength(7);
   });
 
-  it('should render some web vitals with a heading and a sdk warning', async function () {
+  it('should render some web vitals with a heading and a sdk warning', function () {
     const event = makeEvent({fp: 1}, {version: '5.26.0'});
     const wrapper = mountWithTheme(<EventVitals event={event} />);
     expect(wrapper.find('SectionHeading').text()).toEqual('Web Vitals');

+ 4 - 4
tests/js/spec/components/events/interfaces/frame/stacktraceLink.spec.jsx

@@ -73,7 +73,7 @@ describe('StacktraceLink', function () {
     );
   });
 
-  it('renders source url link', async function () {
+  it('renders source url link', function () {
     MockApiClient.addMockResponse({
       url: `/projects/${org.slug}/${project.slug}/stacktrace-link/`,
       query: {file: frame.filename, commitId: 'master', platform},
@@ -92,7 +92,7 @@ describe('StacktraceLink', function () {
     expect(wrapper.find('OpenInName').text()).toEqual('GitHub');
   });
 
-  it('renders file_not_found message', async function () {
+  it('renders file_not_found message', function () {
     MockApiClient.addMockResponse({
       url: `/projects/${org.slug}/${project.slug}/stacktrace-link/`,
       query: {file: frame.filename, commitId: 'master', platform},
@@ -120,7 +120,7 @@ describe('StacktraceLink', function () {
     expect(wrapper.state('match').attemptedUrl).toEqual('https://something.io/blah');
   });
 
-  it('renders stack_root_mismatch message', async function () {
+  it('renders stack_root_mismatch message', function () {
     MockApiClient.addMockResponse({
       url: `/projects/${org.slug}/${project.slug}/stacktrace-link/`,
       query: {file: frame.filename, commitId: 'master', platform},
@@ -146,7 +146,7 @@ describe('StacktraceLink', function () {
     );
   });
 
-  it('renders default error message', async function () {
+  it('renders default error message', function () {
     MockApiClient.addMockResponse({
       url: `/projects/${org.slug}/${project.slug}/stacktrace-link/`,
       query: {file: frame.filename, commitId: 'master', platform},

Некоторые файлы не были показаны из-за большого количества измененных файлов