-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Setting] React 18로 마이그레이션하라 #349
Changes from 4 commits
04ce4db
f92ac7c
a3b92ba
c3c7ed5
6bce4ec
bc5e8d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,13 @@ const customJestConfig = { | |
coveragePathIgnorePatterns: [ | ||
'<rootDir>/src/components/detail/RecruitCompleteCanvasConfetti.tsx', | ||
], | ||
testEnvironment: 'jsdom', | ||
moduleDirectories: ['node_modules', '<rootDir>/'], | ||
testEnvironment: 'jest-environment-jsdom', | ||
}; | ||
|
||
module.exports = createJestConfig(customJestConfig); | ||
module.exports = async () => ({ | ||
...await createJestConfig(customJestConfig)(), | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(@firebase|nanoid|@hookform)/)', | ||
], | ||
Comment on lines
+30
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. node_modules ignore transform Patterns |
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { useForm } from 'react-hook-form'; | |
import { useEffectOnce, useLocalStorage } from 'react-use'; | ||
|
||
import styled from '@emotion/styled'; | ||
import { yupResolver } from '@hookform/resolvers/yup/dist/yup'; | ||
import { yupResolver } from '@hookform/resolvers/yup'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 버전업되면서 경로가 변경됨 |
||
import { User } from 'firebase/auth'; | ||
import * as yup from 'yup'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
import React, { ReactChild, ReactElement } from 'react'; | ||
import React, { PropsWithChildren, ReactElement } from 'react'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import { ChevronLeft } from 'react-feather'; | ||
|
||
import styled from '@emotion/styled'; | ||
|
@@ -11,11 +11,10 @@ import zIndexes from '@/styles/zIndexes'; | |
|
||
interface Props { | ||
previousText: string; | ||
children: ReactChild; | ||
goBack: () => void; | ||
} | ||
|
||
function SubHeader({ goBack, previousText, children }: Props): ReactElement { | ||
function SubHeader({ goBack, previousText, children }: PropsWithChildren<Props>): ReactElement { | ||
return ( | ||
<> | ||
<HeaderBlock> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { renderHook } from '@testing-library/react-hooks'; | ||
import { renderHook, waitFor } from '@testing-library/react'; | ||
|
||
import { getUserAlarm } from '@/services/api/alarm'; | ||
import wrapper from '@/test/ReactQueryWrapper'; | ||
|
@@ -28,23 +28,19 @@ describe('useFetchAlarms', () => { | |
given('alarms', () => null); | ||
|
||
it('빈 배열을 반환해야만 한다', async () => { | ||
const { result, waitFor } = useFetchAlarmsHook(); | ||
const { result } = useFetchAlarmsHook(); | ||
|
||
await waitFor(() => result.current.isSuccess); | ||
|
||
expect(result.current.data).toEqual([]); | ||
await waitFor(() => expect(result.current.data).toEqual([])); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}); | ||
}); | ||
|
||
context('useQuery반환값이 존재하는 경우', () => { | ||
given('alarms', () => [ALARM_FIXTURE]); | ||
|
||
it('alarms에 대한 정보를 반환해야만 한다', async () => { | ||
const { result, waitFor } = useFetchAlarmsHook(); | ||
|
||
await waitFor(() => result.current.isSuccess); | ||
const { result } = useFetchAlarmsHook(); | ||
|
||
expect(result.current.data).toEqual([ALARM_FIXTURE]); | ||
await waitFor(() => expect(result.current.data).toEqual([ALARM_FIXTURE])); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://testing-library.com/docs/dom-testing-library/setup/