test(realtime): add integration tests for collaborative whiteboard features (#60)#97
Open
pithva007 wants to merge 2 commits into
Open
test(realtime): add integration tests for collaborative whiteboard features (#60)#97pithva007 wants to merge 2 commits into
pithva007 wants to merge 2 commits into
Conversation
|
@pithva007 is attempting to deploy a commit to the MINHA's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
Nice work on this! I tested it locally and all 3 tests are failing because of an Invalid token error. JWT_SECRET is being read before dotenv loads, so move it inside createClient(). Also, stopServer() should properly close the socket server, otherwise Jest force exits because of open handles. Fix these two and it should be good to go! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses Issue #60 by establishing a comprehensive automated integration testing suite targeting the core Socket.IO real-time features on both the frontend and backend. It strictly guarantees deterministic test execution by avoiding live ports or real database dependencies.
Backend Testing (Jest + socket.io-client)
socketTestClient.jshelper that seamlessly binds our Express backend to dynamic ports on-the-fly.mongoosepayloads containing method chaining (like.populate()) to avert any MongoDB cloud lookups.Frontend Testing (Vitest + React Testing Library)
socket.io-clientwith a synthetic event emitter architecture allowing test suites to validate internalWhiteboard.jsxstate transitions (e.g. broadcastingclear-canvascorrectly).Related Issues
Closes #60
Testing Checklist
drawing-stroke,draw-element) verified.CI Workflow Summary
.github/workflows/realtime-tests.ymlto automatically execute onpushandpull_requestagainstmain.