rochejul / sequelize-mocking

Sequelize extension to deal with data-mocking for testing
MIT License
63 stars 26 forks source link

Original Sequelize options not passed to mock instance. #32

Closed marcuslieberenzdev closed 4 years ago

marcuslieberenzdev commented 5 years ago

Hi,

I think the second parameter here should be options instead of fixtureFilePath. Otherwise the original sequelize config options (e.g. logging: false) are not passed through to the mock instance.

https://github.com/rochejul/sequelize-mocking/blob/7204464c6ba0cbc6d8fdc7e27db6917ea91a1e91/lib/sequelize-mocking-mocha.js#L33

Regards Marcus

rochejul commented 4 years ago

I use a partialRight function to provide the options parameter See https://github.com/rochejul/sequelize-mocking/blob/7204464c6ba0cbc6d8fdc7e27db6917ea91a1e91/lib/sequelize-mocking-mocha.js#L31

marcuslieberenzdev commented 4 years ago

Hi,

understood. However, I don't provide a fixtureFilePath and when I debug, the options are not passed to SequelizeMocking.create. This happens because the parameter fixtureFilePath is passed to

https://github.com/rochejul/sequelize-mocking/blob/7204464c6ba0cbc6d8fdc7e27db6917ea91a1e91/lib/sequelize-mocking-mocha.js#L33

which is null in this case and thus overwriting the options param provided through _.partialRight.

rochejul commented 4 years ago

Hi @marcuslieberenzdev

Could you provide your test file? I will use it for debugging.

Many thanks

rochejul commented 4 years ago

Close due to inactivity