Ramu Narasinga
02/15/2022, 6:31 AMFile | % 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:
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