Skip to content

Commit

Permalink
improvement(renderfromalien): use "act" from @testing-library/react-h…
Browse files Browse the repository at this point in the history
…ooks

#43
  • Loading branch information
aneurysmjs committed Feb 10, 2020
1 parent 1ae8495 commit 09f1415
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/shared/utils/testing/renderFromAlien.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { renderHook, RenderHookResult } from '@testing-library/react-hooks';
import { renderHook, RenderHookResult, act } from '@testing-library/react-hooks';
import { ReactElement } from 'react';
import { act } from 'react-test-renderer';
import alien, { AlienStore } from '~/store/config/alienStore/alien';
import { withProvider, WrapperType } from '~/store/config/alienStore/helpers/withProvider';
import { State } from '~/store/State';


const store = alien<State>();

const wrapper = withProvider(store);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface RenderFromAlienResult extends RenderHookResult<any, ReactElement> {
store: AlienStore;
wrapper: WrapperType;
Expand All @@ -18,6 +17,7 @@ export interface RenderFromAlienResult extends RenderHookResult<any, ReactElemen
export default async function renderWithAlien(
Ui: () => ReactElement,
): Promise<RenderFromAlienResult> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let hookResult = {} as RenderHookResult<any, ReactElement>;

await act(async () => {
Expand Down

0 comments on commit 09f1415

Please sign in to comment.