File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed
packages/client/tests/e2e/prisma-version-json/tests Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,14 @@ import { expect, test } from 'vitest'
55test ( '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} )
You can’t perform that action at this time.
0 commit comments