Closed ricardobotto closed 6 years ago
Hi @ricardobotto
Could you provide an attachment with a concrete example of your issue please ?
Many thanks
Regards
Hi @rochejul
I'm attaching a more complete example, hope it helps. Transactions structures can be found in controller.txt.
controller.txt index.txt test-spec.txt userModel.txt
Thanks for helping :)
Many thanks !
I try to take some times on the next days to look on it
Thanks
I have the same problem. Any news about resolution? Thanks in advance
Analysis in progress. It seems we could have not the expected QueryGenerator instance, and we use the "abstract" one instead the sqlite dedicated.
Look to find a fix
Regards
Ok, it seems the "queryInterface" property is not updated (new creation since Sequelize 4.X ?) --> https://github.com/sequelize/sequelize/blob/master/lib/sequelize.js#L243
so like the dialect, we have to override it.
Will be deployed soon
Any updates? Still tests fail on calls of transaction.commit()/transaction.rollback()
Hi @ekrotenko Could you please them to give a full example please ? A tiny project to illustrate the issue
Regards
Hi,
I'm unable to mock tests that uses sequelize transactions.
Mocks currently generating START TRANSACTION queries which corresponds to the MySQL syntax.
I already tested using SQLITE as project default database and it correctly generates a query: BEGIN DEFERRED TRANSACTION
Using following transaction templates:
sql.transaction().then(function (t) { return t.commit(); });
sql.transaction(function (t) { });
Both return the following errors:
Am I doing somthing wrong regarding mocks configuration? Here is my Database Instance
const sql = new Sequelize(config.db.database, config.db.username, config.db.password, { host: config.db.host, dialect: config.db.driver, logging: false, operatorsAliases: Sequelize.Op });