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

Function newTransactionFunc

test/integration/transaction.test.js:700–704  ·  test/integration/transaction.test.js::newTransactionFunc
()

Source from the content-addressed store, hash-verified

698 const User = sequelize.define(class="st">'User', { username: Support.Sequelize.STRING });
699 await User.sync({ force: true });
700 const newTransactionFunc = async function() {
701 const t = await sequelize.transaction({ type: Support.Sequelize.Transaction.TYPES.EXCLUSIVE });
702 await User.create({}, { transaction: t });
703 return t.commit();
704 };
705 await Promise.all([newTransactionFunc(), newTransactionFunc()]);
706 const users = await User.findAll();
707 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