MCPcopy
hub / github.com/sequelize/sequelize / newTransactionFunc

Function newTransactionFunc

test/integration/transaction.test.js:713–717  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

711 const User = sequelize.define('User', { username: Support.Sequelize.STRING });
712 await User.sync({ force: true });
713 const newTransactionFunc = async function() {
714 const t = await sequelize.transaction({ type: Support.Sequelize.Transaction.TYPES.EXCLUSIVE });
715 await User.create({}, { transaction: t });
716 return t.commit();
717 };
718 await Promise.all([newTransactionFunc(), newTransactionFunc()]);
719 const users = await User.findAll();
720 expect(users.length).to.equal(2);

Callers 1

Calls 3

transactionMethod · 0.80
commitMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected