File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- const { execSync } = require ( 'node:child_process' ) ;
15+ const { spawnSync } = require ( 'node:child_process' ) ;
1616const { resolve} = require ( 'node:path' ) ;
1717const t = require ( 'tap' ) ;
1818
1919function generatePrismaClient ( ) {
2020 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
21+ const prismaPath = resolve (
22+ __dirname ,
23+ '../../../../node_modules/.bin/prisma'
24+ ) ;
2125
22- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
26+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
27+ stdio : 'inherit' ,
28+ } ) ;
2329}
2430
2531t . test ( 'mysql prisma cjs' , async t => {
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import { execSync } from 'node:child_process' ;
15+ import { spawnSync } from 'node:child_process' ;
1616import { dirname , resolve } from 'node:path'
1717import { fileURLToPath } from 'node:url'
1818import t from 'tap' ;
1919
20+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
21+
2022function generatePrismaClient ( ) {
21- const p = fileURLToPath ( import . meta. url )
22- const __dirname = dirname ( p )
2323 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
24+ const prismaPath = resolve (
25+ __dirname ,
26+ '../../../../node_modules/.bin/prisma'
27+ ) ;
2428
25- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
29+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
30+ stdio : 'inherit' ,
31+ } ) ;
2632}
2733
2834t . test ( 'mysql prisma mjs' , async t => {
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import { execSync } from 'node:child_process' ;
15+ import { spawnSync } from 'node:child_process' ;
1616import { resolve } from 'node:path' ;
1717import t from 'tap' ;
1818
1919function generatePrismaClient ( ) {
2020 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
21+ const prismaPath = resolve ( __dirname , '../../../../node_modules/.bin/prisma' ) ;
2122
22- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
23+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
24+ stdio : 'inherit' ,
25+ } ) ;
2326}
2427
2528t . test ( 'mysql prisma ts' , async t => {
2629 // prisma client generation should normally be part of a regular Prisma
2730 // setup on user end but in order to tests in many different databases
2831 // we run the generation step at runtime for each variation
29- generatePrismaClient ( ) ;
32+ await generatePrismaClient ( ) ;
3033
3134 const {
3235 default : { connect} ,
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- const { execSync } = require ( 'node:child_process' ) ;
15+ const { spawnSync } = require ( 'node:child_process' ) ;
1616const { resolve} = require ( 'node:path' ) ;
1717const t = require ( 'tap' ) ;
1818
1919function generatePrismaClient ( ) {
2020 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
21+ const prismaPath = resolve (
22+ __dirname ,
23+ '../../../../node_modules/.bin/prisma'
24+ ) ;
2125
22- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
26+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
27+ stdio : 'inherit' ,
28+ } ) ;
2329}
2430
31+
2532t . test ( 'pg prisma cjs' , async t => {
2633 // prisma client generation should normally be part of a regular Prisma
2734 // setup on user end but in order to tests in many different databases
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import { execSync } from 'node:child_process' ;
15+ import { spawnSync } from 'node:child_process' ;
1616import { dirname , resolve } from 'node:path'
1717import { fileURLToPath } from 'node:url'
1818import t from 'tap' ;
1919
20+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
21+
2022function generatePrismaClient ( ) {
21- const p = fileURLToPath ( import . meta. url )
22- const __dirname = dirname ( p )
2323 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
24+ const prismaPath = resolve (
25+ __dirname ,
26+ '../../../../node_modules/.bin/prisma'
27+ ) ;
2428
25- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
29+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
30+ stdio : 'inherit' ,
31+ } ) ;
2632}
2733
2834t . test ( 'pg prisma mjs' , async t => {
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import { execSync } from 'node:child_process' ;
15+ import { spawnSync } from 'node:child_process' ;
1616import { resolve } from 'node:path' ;
1717import t from 'tap' ;
1818
1919function generatePrismaClient ( ) {
2020 const schemaPath = resolve ( __dirname , '../schema.prisma' ) ;
21+ const prismaPath = resolve ( __dirname , '../../../../node_modules/.bin/prisma' ) ;
2122
22- execSync ( `npm exec prisma -- generate --schema=${ schemaPath } ` ) ;
23+ spawnSync ( prismaPath , [ 'generate' , `--schema=${ schemaPath } ` ] , {
24+ stdio : 'inherit' ,
25+ } ) ;
2326}
2427
2528t . test ( 'pg prisma ts' , async t => {
You can’t perform that action at this time.
0 commit comments