()
| 188 | let trx1: Transaction | undefined; |
| 189 | let trx2: Transaction | undefined; |
| 190 | const work = async () => { |
| 191 | await em.transactional(async em => { |
| 192 | em1 = em; |
| 193 | trx1 = em.getTransactionContext(); |
| 194 | username = 'nested1'; |
| 195 | const user = new User(username); |
| 196 | em.persist(user); |
| 197 | await em.transactional(async em => { |
| 198 | em2 = em; |
| 199 | trx2 = em.getTransactionContext(); |
| 200 | username = 'nested2'; |
| 201 | const user = new User(username); |
| 202 | em.persist(user); |
| 203 | }); |
| 204 | }); |
| 205 | }; |
| 206 | await expect(work()).resolves.toBeUndefined(); |
| 207 | expect(beforeTransactionStart).toHaveBeenCalledTimes(2); |
| 208 | expect(beforeTransactionStart).toHaveBeenCalledWith( |
no test coverage detected