Skip to content

Commit

Permalink
test: 테스트 환경 설정 및 테스트 코드 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 committed Nov 29, 2024
1 parent e87fb74 commit 55d7745
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react/src/components/InView/InView.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,10 @@ describe('InView', () => {
expect(intersectStartMock).toBeCalledTimes(1);
expect(intersectEndMock).toBeCalledTimes(1);
});

it('asChild가 true일 때 children이 유효한 React 요소가 아니면 에러를 반환해야 합니다.', () => {
expect(() =>
renderSetup(<InView asChild={true}>일반 텍스트 노드</InView>)
).toThrow();
});
});
2 changes: 2 additions & 0 deletions packages/react/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export default defineConfig({
exclude: [
'src/utils/**',
'src/_internal/**',
'src/**/internal.ts',
'src/**/*.utils.ts',
'src/hooks/useClipboard',
'src/hooks/useResizeObserver',
...coverageConfigDefaults.exclude,
],
},
Expand Down

0 comments on commit 55d7745

Please sign in to comment.