Skip to content

Commit f2ab6a5

Browse files
authored
fix: client-extension test failures (#874)
1 parent 251174e commit f2ab6a5

File tree

5 files changed

+71
-89
lines changed

5 files changed

+71
-89
lines changed

packages/schema/src/cli/actions/repl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export async function repl(projectPath: string, options: { prismaClient?: string
171171
prisma.$disconnect();
172172
}
173173
prisma = new PrismaClient(debug ? { log: ['info'] } : undefined);
174+
// https://github.com/prisma/prisma/issues/18292
174175
prisma[Symbol.for('nodejs.util.inspect.custom')] = 'PrismaClient';
175176
db = enhance(prisma, { user }, { logPrismaQuery: debug });
176177

packages/testtools/src/schema.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ export async function loadSchema(schema: string, options?: SchemaLoadOptions) {
221221

222222
const PrismaClient = require(path.join(projectRoot, 'node_modules/.prisma/client')).PrismaClient;
223223
let prisma = new PrismaClient({ log: ['info', 'warn', 'error'] });
224+
// https://github.com/prisma/prisma/issues/18292
225+
prisma[Symbol.for('nodejs.util.inspect.custom')] = 'PrismaClient';
226+
227+
const Prisma = require(path.join(projectRoot, 'node_modules/@prisma/client')).Prisma;
224228

225229
if (opt.pulseApiKey) {
226230
const withPulse = require(path.join(projectRoot, 'node_modules/@prisma/extension-pulse/dist/cjs')).withPulse;
@@ -244,6 +248,7 @@ export async function loadSchema(schema: string, options?: SchemaLoadOptions) {
244248
if (options?.getPrismaOnly) {
245249
return {
246250
prisma,
251+
Prisma,
247252
projectDir: projectRoot,
248253
withPolicy: undefined as any,
249254
withOmit: undefined as any,
@@ -277,6 +282,7 @@ export async function loadSchema(schema: string, options?: SchemaLoadOptions) {
277282
return {
278283
projectDir: projectRoot,
279284
prisma,
285+
Prisma,
280286
withPolicy: (user?: AuthUser) =>
281287
withPolicy<FullDbClientContract>(
282288
prisma,

pnpm-lock.yaml

Lines changed: 29 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
"jest-fetch-mock": "^3.0.3",
3030
"next": "^12.3.1",
3131
"tmp": "^0.2.1",
32-
"ts-jest": "^29.0.1",
32+
"ts-jest": "^29.1.1",
3333
"ts-node": "^10.9.1",
3434
"typescript": "^4.6.2",
3535
"uuid": "^9.0.0",
36-
"zenstack": "workspace: *",
37-
"prisma-client-test-internal": "npm:@prisma/client@^5.0.0"
36+
"zenstack": "workspace: *"
3837
},
3938
"dependencies": {
4039
"@types/node": "^18.0.0",

0 commit comments

Comments
 (0)