Skip to content
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

[hotfix] peerDependencies로 포함된 모듈 부재로 인한 Jest 불가 상태 해결 #9

Closed
cadenzah opened this issue Aug 12, 2020 · 0 comments
Assignees
Labels
HIGH The highest job priority

Comments

@cadenzah
Copy link
Owner

cadenzah commented Aug 12, 2020

Branch Name

hotfix/9-install-peerDep

Type of Change

environment

Priority

high

Summary

React 모듈을 peerDependencies로 유지하고, 테스트 프로젝트와 모듈 프로젝트가 동일한 React 모듈을 참조하도록 환경 설정

Description of Change

  • 테스트 프로젝트에 install-peers-cli를 추가하고, 이를 실행
    • 해당 라이브러리에 버그가 있어 실행이 안 되므로, -f 옵션을 부여하여 강제 실행
    • 이 스크립트는 package-jsonpackage-lock 파일을 건드리지 않고 모듈만을 설치
  • 테스트 프로젝트의 React 모듈을 yarn link 등록, 모듈 프로젝트에서 yarn link react실행하여 외부의 React 모듈 참조
    • React Hooks 사용을 위한 조치

Prerequisite

  • 테스트 프로젝트에서는 모듈 프로젝트를 yarn link videojs-react-enhanced로 참조
    • 테스트 프로젝트 상의 모듈 프로젝트에 React 모듈이 존재하면 안 된다

Reason for Change

NPM 모듈 배포를 위하여 react 모듈을 peerDependencies로 이전시키고 node_modules/에서 제거해버리자, 모듈로 import하여 사용하는 데에는 문제가 없었으나 모듈 프로젝트 내에서 테스트를 할 때에 react 모듈을 사용하지 못하는 상황이 발생하였다.

테스트의 원활한 진행을 위하여 React 모듈을 peerDependencies로 유지하고, 테스트 프로젝트와 모듈 프로젝트가 동일한 React 모듈을 참조하도록 수동으로 환경을 설정하여 원활한 테스트가 이루어지도록 한다.

Expected Next or Associated Work (If exists)

  • 모듈 개발 또는 유지보수시 테스트 환경 세팅 방법 문서화

Estimated Story Point

2

Reference (If exists)

@cadenzah cadenzah self-assigned this Aug 12, 2020
@cadenzah cadenzah added the HIGH The highest job priority label Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HIGH The highest job priority
Projects
None yet
Development

No branches or pull requests

1 participant