Samagra-Development / yaus

Yet Another URL Shortner
https://github.com/Samagra-Development/yaus/wiki
11 stars 28 forks source link

Failing test in monorepo #54

Closed Nazi-pikachu closed 1 year ago

Nazi-pikachu commented 1 year ago

Describe the bug Tests are failing in the monorepo.

To Reproduce Steps to reproduce the behavior:

  1. Clone the monorepo
  2. Install dependencies
  3. Run yarn test api

Expected behavior The test should pass in the monorepo

Screenshots image

Desktop (please complete the following information):

Additional context There are two prime reason for failing test

  1. Prisma client imports are breaking
  2. PostHog project api key is mandatory to pass
Nazi-pikachu commented 1 year ago

@Maintainers Can anyone please help me out with this, I am trying to intergrate the code written in the previous edition of C4GT to the current monrepo but the test are failings. CC: @ChakshuGautam

ChakshuGautam commented 1 year ago

Hey @Nazi-pikachu please fix the test cases as you go about this PR. Is there a draft PR I can look into? I can then contribute to these test cases parallelly as well. Thanks.

yuvrajsab commented 1 year ago

hey @Nazi-pikachu have you generated the Prisma client before running the tests?

Nazi-pikachu commented 1 year ago

Hi @yuvrajsab Thanks for pointing it out, earlier i was not generating Prisma client. However tests related to Telemetry services are still failing Can you give more context about the whole process you follow before running tests. It would be very helpful.

yuvrajsab commented 1 year ago

hey, @Nazi-pikachu I have just run the tests using yarn test api and they are all passing. And no Posthoh API key is not necessary to run the test I have put there a dummy API key and API host and it is still passing. Or you can create an account on Posthog for testing it's free for upto 1m events.

POSTHOG_API_KEY=adasdsad
POSTHOG_API_HOST=https://example.com

image

Nazi-pikachu commented 1 year ago

Thanks @yuvrajsab Its now passing all the test cases by taking a dummy api key.