Skip to content

[WOC] add unit tests and opt express_pg_sequelize template#118

Closed
priyansh-narang2308 wants to merge 3 commits intoCSE-25:mainfrom
priyansh-narang2308:feat/test-express-pg-sequelize
Closed

[WOC] add unit tests and opt express_pg_sequelize template#118
priyansh-narang2308 wants to merge 3 commits intoCSE-25:mainfrom
priyansh-narang2308:feat/test-express-pg-sequelize

Conversation

@priyansh-narang2308
Copy link
Contributor

description

This pr fix issue #29 by adding basic testing and small architecture improvments to the express_pg_sequelize template.

key changes

  • use jest db mocking so api tests run fast without postgres running.
  • export express app and wrap app.listen to avoid port issue while testing.
  • add jest and supertest with a simple npm test script.
  • tests added: cover root route and db routes, incl error cases.

how to test

  1. qse init -t express_pg_sequelize -n test-app
  2. cd test-app
  3. npm install
  4. npm test

@Devpool-soc
Copy link
Collaborator

Hey @priyansh-narang2308! Thank you for opening a pull request. Make sure to tag the maintainers and link the issue you are solving in your pull-request description if you have not already and they'll review as soon as possible.

@priyansh-narang2308
Copy link
Contributor Author

It had an error in testing which fixed

@Ashrockzzz2003 Ashrockzzz2003 self-requested a review January 7, 2026 18:12
@Ashrockzzz2003 Ashrockzzz2003 linked an issue Jan 7, 2026 that may be closed by this pull request
2 tasks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to be same as the original js file - index.test.js - it'll improve readability

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the changes @Ashrockzzz2003

@priyansh-narang2308 priyansh-narang2308 closed this by deleting the head repository Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test cases for express_pg_sequelize

3 participants