Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. gkanwar
G

gkanwar

@gkanwar

Chat Follow Unfollow
0
Reputation
2
Posts
909
Profile views
0
Followers
0
Following
Joined 1 Apr 2020, 19:35 Last Online 12 Apr 2020, 14:49

  • Profile
  • More
    • Continue chat with gkanwar
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
gkanwar Follow

Posts made by gkanwar

RE: Nice way to test websocket server using mocha/chai?

Thanks @endel! Good to know that I should not rely on specifics of the server-client dynamics of Colyseus. I guess this is good encouragement to move all the random tidbits of game logic in my Room into other classes that are testable.

By the way, are there any good open source examples of card games built on top of Colyseus? It would be helpful to see some examples of good server code architecture.

Thanks!

posted in Questions & Help • 1 Apr 2020, 19:55
Nice way to test websocket server using mocha/chai?

This question may be stemming from general newness to the whole NodeJs ecosystem, apologies if it's not too specific to colyseus. I have a general understanding of how Mocha/Chai testing works and have run tests on another project in the past. But with the presence of a websocket server and asynchronous state patches flying around I'm not sure of a good testing paradigm for a colyseus game engine. I am working on an entirely turn-based game, so careful checks of timing is not an issue, I would just like to check that my messaging system and state updates work as expected based on the desired game logic. Any suggestions?

So far I have set up a simple MyRoom.test.js script that starts up a colyseus server and makes colyseus.js clients. I can test simple connecting / room creation using async Mocha/Chai tests. I'm a bit stuck on how to check for state updating the way I expect it to, since this is asynchonously patched.

posted in Questions & Help • 1 Apr 2020, 19:42

© 2023 Endel Dreyer