Skip to content

Commit

Permalink
test(client): chaining of requestTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp committed Feb 9, 2022
1 parent 5d1dd5e commit adf4da5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/client/src/__tests__/integration/happy/chaining/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@ describe('chaining', () => {
expect(createResult1).toStrictEqual(createResult2)
})

test('repeated calls to .requestTransaction', async () => {
const createPromise = prisma.user.create({
data: {
email: 'email@email.em',
},
})

// repeated calls to then & co should not change the result
const createResult1 = await createPromise.requestTransaction(1)
const createResult2 = await createPromise.requestTransaction(1)

expect(createResult1).toStrictEqual(createResult2)
})

beforeAll(async () => {
const PrismaClient = await getTestClient()
prisma = new PrismaClient()
Expand Down

0 comments on commit adf4da5

Please sign in to comment.