Skip to content

Instantly share code, notes, and snippets.

View dyllandry's full-sized avatar
🍞

Dylan Landry dyllandry

🍞
  • Tactus Therapy
  • Toronto, ON, Canada
View GitHub Profile
@mltsy
mltsy / monkeyPatchSequelizeErrorsForJest.js
Last active March 3, 2026 17:07
Monkey Patch for the unfriendly errors thrown by Sequelize 6
/**
* This monkey patch fixes an error reporting issue with sequelize errors in tests,
* which was fixed in Sequelize v7, but hasn't been back-ported to Sequelize v6.
* See https://github.com/sequelize/sequelize/issues/14807#issuecomment-1854398131
*
* It should only be used in the test env, to make Sequelize error messages show up.
* This can be removed when we upgrade to Sequelize 7, or when the issue is fixed in v6.
*/
const { Sequelize } = require('sequelize')