Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't mock special fn in prisma package #108

Open
hadeelfouad opened this issue Jan 26, 2023 · 0 comments
Open

Doesn't mock special fn in prisma package #108

hadeelfouad opened this issue Jan 26, 2023 · 0 comments

Comments

@hadeelfouad
Copy link

Tried the following code to mock my PrismaClient using JavaScript

import { PrismaClient } from '@prisma/client';
import { mockDeep } from 'jest-mock-extended';

export const createDatabase = () => {
  return mockDeep(PrismaClient.prototype);
}

And it was able to successfully mock all models functions but not any functions starting with $ (for example $transaction, $on, etc.) it still calls the real function even though the PrismaClient is a MockObject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant