Skip to content

Migrate session.controller to TypeScript#4105

Open
dvynshuu wants to merge 1 commit intoprocessing:developfrom
dvynshuu:migrate-session-controller-ts
Open

Migrate session.controller to TypeScript#4105
dvynshuu wants to merge 1 commit intoprocessing:developfrom
dvynshuu:migrate-session-controller-ts

Conversation

@dvynshuu
Copy link
Copy Markdown

Issue:
Part of the 2025 pr05 Grant: Incremental Typescript Migration of the p5.js Web Editor

This PR incrementally migrates the backend session.controller.js file to TypeScript (session.controller.ts) and adds full unit test coverage according to the established TS migration guidelines.

Demo:
N/A - Backend / TypeScript migration only.

Changes:
Renamed server/controllers/session.controller.js to server/controllers/session.controller.ts.
Added Types: Typed the Express middleware methods (createSession, getSession, destroySession) using RequestHandler and Express.User.
Added JSDoc Comments: Included comprehensive JSDocs specifying methods, endpoints, and descriptions for all controller methods.
Added Unit Tests: Created server/controllers/tests/session.controller.test.ts with 10 unit tests covering all success/failure paths, utilizing jest-express for mocking the request/response context.
Fixed minor linting (shadowing) warnings that appeared after conversion.

I have verified that this pull request:

@welcome
Copy link
Copy Markdown

welcome Bot commented Apr 30, 2026

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

text editor + canvas sometimes don't load on Safari

1 participant