rochejul / sequelize-mocking

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

fixtureFilePath array #21

Closed julesGoullee closed 6 years ago

julesGoullee commented 6 years ago

It's usefull to have multiple files, for split many data in differentes files, this PR have no regression, filePath can be an array of path or (like actually) just a string

julesGoullee commented 6 years ago

Why support node 4 & 6 , 8.9 in LST since november 2017

rochejul commented 6 years ago

Hi I check at least forNodeJs 4.x because the NodeJs version fragmentation show there are still a lot of people using NodeJs less thant 6.x (nearly 30% if I remember). So this is important to check if it could work too on their side.

So please not use for the moment the "async" keyword (which is only a shortcut to generate a Promise)

Maybe I should put more documentation, but we already could load multiple file with using this syntax:

sequelize_fixtures.loadFile('fixtures/*.json', models, {})

However, I will adapt the fixtureFilePath parameter to allow declare an array so use the following methods (instead made a for-loop):

sequelize_fixtures.loadFiles(['fixtures/users.json', 'fixtures/data*.json'], models, {})

Could do create an enhancement ticket please ?

Many thanks

rochejul commented 6 years ago

Plus, Sequelize itself tries to be compatible with NodeJs 4.x: https://github.com/sequelize/sequelize/blob/master/package.json#L141

Regards

julesGoullee commented 6 years ago

Yep *.json it's not good, for respect sql contraint I need to insert data in the right order and sync

rochejul commented 6 years ago

Many thanks

Two feedbacks:

Many thanks again

Regards

rochejul commented 6 years ago

I will perte jour pull request this week-end ans update the documentation and unit test Regards

rochejul commented 6 years ago

Many thanks: I have published on npm the 1.3.0-beta version with your updates

Regards