vi.mock('sequelize', async () => { const mSequelize = { authenticate: vi.fn(), define: vi.fn(), } const actualSequelize = await import('sequelize') return { ...actualSequelize, Sequelize: vi.fn(() => mSequelize) } })
How to mock Sequelize with Jest?
I am trying to write unit tests for code which makes calls to Sequelize to create a database. I cannot for the life of me figure out how to mock out calls to Sequelize such that I can assert they h...
https://stackoverflow.com/questions/64648688/how-to-mock-sequelize-with-jest

Seonglae Cho