Skip to content

How to run tests in transaction in conjunction with @UseRequestContext()? #107

Answered by B4nan
tolgap asked this question in Q&A
Discussion options

You must be logged in to vote

v6 adds EnsureRequestContext, you could copy that to your project and use it instead - it will create new context only if not already available. you would still need to create the async context, i dont think you have that in your test right now.

await RequestContext.create(em, async () => {
  // ...
});

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tolgap
Comment options

@B4nan
Comment options

B4nan Mar 1, 2023
Maintainer

@tolgap
Comment options

Answer selected by tolgap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants