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

THE REFACTOR #18

Open
Aslemammad opened this issue Apr 26, 2024 · 9 comments
Open

THE REFACTOR #18

Aslemammad opened this issue Apr 26, 2024 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@Aslemammad
Copy link
Member

For now, all the tests are e2e and they send real requests and real data.

That's why we have so many comments in stackblitz-labs/temporary-test#1

It's better to someway mock those requests and achieve faster tests.

@Aslemammad Aslemammad added the help wanted Extra attention is needed label Apr 26, 2024
@Aslemammad Aslemammad changed the title Mock tests Better tests Apr 26, 2024
@Aslemammad
Copy link
Member Author

Aslemammad commented May 5, 2024

Ok, this is way important than I thought after working on #36!

We need smoother tests. And agile ones.

  • Mocking github apis. test: pr temporary-test#1 is being spammed basically
  • doing things straight in workers (vitest-workers?). I hate running tests again & again.
  • (THIS SHOULD BE INVESTIGATED MORE) removing nitro & only using h3 (nitro core). Because we still do pnpm build && pnpm preview which is not ideal.
  • Tests should be smoother & easier to write anyway. The current method was the best for the start, but now, it's just unproductive & demotivating.

@Aslemammad Aslemammad changed the title Better tests THE REFACTOR May 5, 2024
@Aslemammad
Copy link
Member Author

Should be dealt with after the beta milestone!

@romadryud
Copy link

romadryud commented Jun 20, 2024

@Aslemammad We are using msw for mocking api call's. Do you have a plan where what and why needed to be tested first? I'm happy to help with some contribution!

@Aslemammad
Copy link
Member Author

Thank you so much, for sure! we'd be happy to have you.

What we want to achieve is potentially remove the e2e directory and have vitest there and we do not rely on any github api call for instance. So the test should run completely offline, I do not know if this is doable or not, but I guess it is.

@AriPerkkio shared few thoughts with me a while ago, I'd like to see his direction too.

@romadryud
Copy link

romadryud commented Jun 24, 2024

@Aslemammad, I'll create a pull request this week, and we can have a discussion based on some code :)

@AriPerkkio
Copy link

AriPerkkio commented Jun 24, 2024

Here's the Github API mock I've used with MSW:

The second one is a Github action that does PR comments as well.

@Aslemammad
Copy link
Member Author

Thank you all, I'm really excited.

@mahdikhashan
Copy link

@Aslemammad is it still an issue? I couldn't find a related PR. I'd like to work on it.

@Aslemammad
Copy link
Member Author

For sure, feel free to send your explorations in a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants