BlinkUX / sequelize-mock

A simple mock interface specifically for testing code relying on Sequelize models
https://sequelize-mock.readthedocs.io
MIT License
139 stars 73 forks source link

transaction commit/rollback/LOCK/afterCommit #87

Closed Talg123 closed 2 years ago

Talg123 commented 3 years ago

Hi, looks like the mock missing few key functions from the return transaction function. for example:

    const transaction = await sequelize.transaction();
    const addedUser = await Users.create(myUserObject, { transaction });
        // doing some other code with transaction;
       try {
          await transaction.commit();
       } catch (e) {
           await transaction.rollback()
       }

that some basic way of working with transaction those days.