()
| 157 | }; |
| 158 | |
| 159 | const secondTransaction = async () => { |
| 160 | await delay(500); |
| 161 | await this.sequelize.transaction({ isolationLevel }, async t => { |
| 162 | await Dots.update({ color: 'green' }, { |
| 163 | where: { color: 'red' }, |
| 164 | transaction: t |
| 165 | }); |
| 166 | |
| 167 | // Sanity check - in this test we want this line to be reached before the |
| 168 | // first transaction gets to commit |
| 169 | expect(firstTransactionGotNearCommit).to.be.false; |
| 170 | |
| 171 | secondTransactionGotNearCommit = true; |
| 172 | }); |
| 173 | }; |
| 174 | |
| 175 | await expect( |
| 176 | Promise.all([firstTransaction(), secondTransaction()]) |
no test coverage detected