Closed YutaUra closed 1 year ago
Perhaps this could be accomplished by setting up a SAVEPOINT or something like that
postgres: https://www.postgresql.org/docs/15/sql-savepoint.html mysql: https://dev.mysql.com/doc/refman/8.0/en/savepoint.html sqlite: https://www.sqlite.org/lang_savepoint.html
Released in version 1.5.0 🎉
Set enableExperimentalRollbackInTransaction
in testEnvironmentOptions to true.
/* jest.config.mjs */
export default {
testEnvironment: "@quramy/jest-prisma/environment",
testEnvironmentOptions: {
enableExperimentalRollbackInTransaction: true, // <- add this
},
};
Currently, jest-prisma is not able to reproduce the phenomenon of rollback in transactions, but it would be better if it could!
see: https://github.com/Quramy/jest-prisma/issues/87