Refactor/path 임포트 경로 별칭 적용 #67
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🛠️ 코드 리팩토링
기존의 상대경로 import를 alias 설정을 통해 절대경로 방식으로 개선하였습니다.
👎🏼 Before

👍🏼 After

변경된 환경
참고 사항
nest build 시에 src 외부의 test 폴더는 포함되지 않기 때문에 "@mock/": ["../test/mock/"] 이 값이 에러를 발생시킬 수 있다고 합니다.
@ mock는 테스트 파일에서만 사용되므로 tsconfig.json에서 제거 후 jest.config.ts 에서 아래처럼 수동 매핑 처리를 해줬는데, 적용이 안됩니다. ㅜㅜ
그래서 tsconfig.test.ts 파일을 새로 만들어 해당 파일에서 설정해도 적용이 안됩니다..
test 폴더도 src 내부로 옮기면 해결되겠지만 빌드 대상에 테스트 폴더를 포함시키는 게 좋지 않은 것 같아서요
관련해서 의견 부탁드립니다 😿