Hi, Using interactive transactions, my unit test c...
# orm-help
r
Hi, Using interactive transactions, my unit test coverage is very low for a service file:
Copy code
File                                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                         
CardService.ts            |  26.09 |   16.67 |  44.44 |  26.09 | 47-48,65-77,98-109,133-203,226-291
A code snippet of
prisma
transaction I use in
Cardservice
is as follows:
Copy code
archiveCard(cardId: number): Promise<Card> {
    return this.prisma.$transaction(async (prisma) => {
      #47 await this.handleOriginalPosition(cardId, prisma);
      #48 return prisma.card.update({
        where: { id: cardId },
        data: { CardMisc: { update: { isArchived: true } } },
      });
    });
}
The above snippet has line #47-48, is there a way we could perform unit tests on code written inside transaction function? We use similar transactions in lines:
65-77,98-109,133-203