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

[BE] 27.07 주식 실시간/일별 체결가 서비스 테스트 코드 작성 #237 #246

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

uuuo3o
Copy link
Collaborator

@uuuo3o uuuo3o commented Dec 2, 2024

✅ 주요 작업

  • 특정 주식의 현재가 체결 데이터 반환
  • 특정 주식의 일별 체결 데이터 반환

💭 고민과 해결과정

  • 의존성을 타고 타고.. 계속 추가해야 하길래 상당히 당황스러웠지만,
    아래 코드처럼, 필요한 함수에 대해서만 모킹하고, 실제로는 호출되지 않게 작성했다!
beforeEach(async () => {
    const module = await Test.createTestingModule({
      providers: [
        StockTradeHistoryService,
        KoreaInvestmentDomainService,
        {
          provide: StockPriceSocketService,
          useValue: {
            subscribeByCode: jest.fn(), // 이 메서드만 모킹합니다.
          },
        },
      ],
    }).compile();

// ...
    jest
      .spyOn(stockPriceSocketService, 'subscribeByCode')
      .mockImplementation(() => {});

@uuuo3o uuuo3o added BE 백엔드 TEST 테스트 코드 작성 API API 구현 labels Dec 2, 2024
@uuuo3o uuuo3o requested review from jinddings and sieunie December 2, 2024 10:49
@uuuo3o uuuo3o self-assigned this Dec 2, 2024
@uuuo3o uuuo3o linked an issue Dec 2, 2024 that may be closed by this pull request
@uuuo3o uuuo3o changed the title [BE] 27.07 주식 실시간/일별 체결가 서비스 테스트 코드 작 #237 [BE] 27.07 주식 실시간/일별 체결가 서비스 테스트 코드 작성 #237 Dec 2, 2024
Copy link
Collaborator

@sieunie sieunie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당~

@uuuo3o uuuo3o merged commit 741d015 into back/main Dec 3, 2024
2 checks passed
@uuuo3o uuuo3o deleted the test/tradeHistory-#237 branch December 5, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API 구현 BE 백엔드 TEST 테스트 코드 작성
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 27.07 백엔드 테스트 코드 작성
2 participants