Skip to content

Commit

Permalink
test(turso): uncomment orThrow methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 authored May 7, 2024
1 parent 35b1cf5 commit ecca5b5
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 105 deletions.
30 changes: 14 additions & 16 deletions driver-adapters-wasm/turso-cf-basic/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,20 @@ test('prisma version and output', async () => {
},
]
`)
// TODO skipped because of bug: "User Not Found"

// expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
// expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)

// Skipping this because of too many sub-requests (limit is 50 per fetch call)

Expand Down
36 changes: 17 additions & 19 deletions driver-adapters-wasm/turso-cf-basic/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,23 @@ export default {
age: true,
},
}),
// TODO skipped because of bug: "User Not Found"

// findFirstOrThrow: await prisma.user.findFirstOrThrow({
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
// findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
// where: {
// email: 'test-2@prisma.io',
// },
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
findFirstOrThrow: await prisma.user.findFirstOrThrow({
select: {
age: true,
email: true,
name: true,
},
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-2@prisma.io',
},
select: {
age: true,
email: true,
name: true,
},
}),
// Skipping this because of too many sub-requests (limit is 50 per fetch call)

// upsert: await prisma.user.upsert({
Expand Down
37 changes: 18 additions & 19 deletions driver-adapters-wasm/turso-cfpages-basic/functions/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,24 @@ export async function onRequest(context) {
age: true,
},
}),
// TODO skipped because of bug: "User Not Found"

// findFirstOrThrow: await prisma.user.findFirstOrThrow({
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
// findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
// where: {
// email: 'test-2@prisma.io',
// },
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
findFirstOrThrow: await prisma.user.findFirstOrThrow({
select: {
age: true,
email: true,
name: true,
},
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-2@prisma.io',
},
select: {
age: true,
email: true,
name: true,
},
}),

// Skipping this because of too many sub-requests (limit is 50 per fetch call)

// upsert: await prisma.user.upsert({
Expand Down
30 changes: 14 additions & 16 deletions driver-adapters-wasm/turso-cfpages-basic/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,20 @@ test('prisma version and output', async () => {
},
]
`)
// TODO skipped because of bug: "User Not Found"

// expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
// expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)

// Skipping this because of too many sub-requests (limit is 50 per fetch call)

Expand Down
30 changes: 14 additions & 16 deletions driver-adapters-wasm/turso-vercel-nextjs-edgemw/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,20 @@ test('prisma version and output', async () => {
},
]
`)
// TODO skipped because of bug: "User Not Found"

// expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
// expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
// {
// "age": 29,
// "email": "test-2@prisma.io",
// "name": "Test 2",
// }
// `)
expect(regResult.findFirstOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
expect(regResult.upsert).toMatchInlineSnapshot(`
{
"age": 30,
Expand Down
36 changes: 17 additions & 19 deletions driver-adapters-wasm/turso-vercel-nextjs-edgemw/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,23 @@ async function getResponse() {
age: true,
},
}),
// TODO skipped because of bug: "User Not Found"

// findFirstOrThrow: await prisma.user.findFirstOrThrow({
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
// findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
// where: {
// email: 'test-2@prisma.io',
// },
// select: {
// age: true,
// email: true,
// name: true,
// },
// }),
findFirstOrThrow: await prisma.user.findFirstOrThrow({
select: {
age: true,
email: true,
name: true,
},
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-2@prisma.io',
},
select: {
age: true,
email: true,
name: true,
},
}),
upsert: await prisma.user.upsert({
where: {
email: 'test-4@prisma.io',
Expand Down

0 comments on commit ecca5b5

Please sign in to comment.