Next.js Discord

Discord Forum

Testing a game :)

Answered
Arinji posted this in #help-forum
Open in Discord
Ok so I have a bunch of game logic I want an entire test setup around, stuff like adding points, managing players, streaks etc.

Now I have done end to end with playwright before but is there any better way to test my game logic itself?

Also ideally they get run on GitHub actions so

Thanks :)
Answered by James4u
hmm @Arinji I think you want unit testing then
View full answer

7 Replies

hmm @Arinji I think you want unit testing then
Answer
@James4u hmm <@890486507872342027> I think you want unit testing then
Hmm, what would be the difference?
Like wrt to react
Unit tests are for testing individual parts of your code and test them independently, ensuring that each component works correctly.
Ah, and so if I wanted to test the entire page, I would do end to end
yeah, and from my experience both e2e and unit tests are needed
Got it, thanka