Skip to content

Commit 4a62616

Browse files
committed
chore: address review comments
1 parent a783858 commit 4a62616

File tree

1 file changed

+9
-15
lines changed
  • packages/client/tests/e2e/prisma-version-json/tests

1 file changed

+9
-15
lines changed

packages/client/tests/e2e/prisma-version-json/tests/main.test.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@ import { expect, test } from 'vitest'
55
test('prisma version --json outputs valid JSON', () => {
66
// Run prisma version --json | jq and check exit code
77
// jq will exit with code 0 if JSON is valid, non-zero otherwise
8-
try {
9-
const output = execSync('pnpm exec prisma version --json | jq .', {
10-
encoding: 'utf-8',
11-
shell: '/bin/sh',
12-
})
8+
const output = execSync('pnpm exec prisma version --json | jq .', {
9+
encoding: 'utf-8',
10+
shell: '/bin/sh',
11+
})
1312

14-
// additional check: verify that the output is valid JSON by parsing it
15-
const jsonOutput = output.trim()
16-
expect(() => JSON.parse(jsonOutput)).not.toThrow()
17-
18-
// verify it contains expected fields
19-
const parsed = JSON.parse(jsonOutput)
20-
expect(parsed).toHaveProperty('prisma')
21-
} catch (error: any) {
22-
throw new Error(`Command failed with exit code ${error.status}: ${error.message}`)
23-
}
13+
// additional check: verify that the output is valid JSON by parsing it
14+
const jsonOutput = output.trim()
15+
// verify it contains expected fields
16+
const parsed = JSON.parse(jsonOutput)
17+
expect(parsed).toHaveProperty('prisma')
2418
})

0 commit comments

Comments
 (0)