Closed lytc closed 3 years ago
Hi @lytc, thanks for the contribution!
I feel you also need to add the runInTransaction
function to the exports within the index.ts
Not sure if this is the correct thread to bring this up, but I feel it might be related; I'm using this library indirectly (through typeorm-test-transactions), and I was wondering if it would possible to have separate "start" and "stop" transaction methods? So not a function wrapper (or decorator).
I hope to be able to use it in before/after hooks of jest, to automatically "wrap" every test in a transaction;
beforeEach(() => startTransaction());
test('do something with the database', async () => {
await someDbAction();
});
afterEach(() => rollbackTransaction());
Or more plainly;
await startTransaction();
await someDbAction();
await rollbackTransaction();
Hi @lytc, thanks for the contribution!
I feel you also need to add the
runInTransaction
function to the exports within the index.ts
I added that already!
Hi @odavid , Thanks for your review, I make the change regarding to your comments!
Thank you!
Hi @odavid , I created this PR for this request https://github.com/odavid/typeorm-transactional-cls-hooked/issues/92, could you help to have a look?