Skip to content

How did you make the test example work? #2327

Description

@jtlindsey

Hello
How did you make the test example work in here?

import { PrismaClient } from '@prisma/client'
import { mockDeep } from 'jest-mock-extended'
import { DeepMockProxy } from 'jest-mock-extended/lib/Mock'

export type Context = {
  prisma: PrismaClient
}

export type MockContext = {
  prisma: DeepMockProxy<PrismaClient>
}

export const createMockContext = (): MockContext => {
  return {
    prisma: mockDeep<PrismaClient>(),
  }
}

With jest-mock-extended both version 1.0.15 and 2.0.0, DeepMockProxy causes an error Module '"jest-mock-extended/lib/Mock"' has no exported member 'DeepMockProxy'

If I change setup to import { mockDeep, mockReset, DeepMockProxy } from 'jest-mock-extended'; to correlate with marchaos/jest-mock-extended#72 I still get no export member error.

Is this a typescript issue?

Here is my tsconfig.json

{
   "exclude": [
      "node_modules"
   ],
   "compilerOptions": {
      "lib": [
         "es5",
         "es6"
      ],
      "target": "es6",
      "module": "commonjs",
      "moduleResolution": "node",
      "outDir": "./build",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "sourceMap": true,
      "skipLibCheck": true
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/docsDocumentation creation, updates or corrections

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions