Skip to content

Doesn't mock special fn in prisma package #108

Open
@hadeelfouad

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions