title: What is the simplest way to test prisma service (prisma.service.ts)?
body: <p>Let's assume the primsa.service.ts files look likes this. Can anyone suggest what would be the simplest way to test this particular file covering both the methods in nestjs testing.</p>
  <pre><code>import { INestApplication, Injectable, OnModuleInit } from '@nestjs/common';
  import { PrismaClient } from '@prisma/client';
  
  @Injectable()
  export class PrismaService extends PrismaClient implements OnModuleInit {
  
    constructor() {
      super({
        ...(process.env.NODE_ENV === &quot;development&quot; ? {
          log: ['query', 'info', 'warn', 'error']
        } : {}),
        datasources: {
          db: {
            url: process.env.DATABASE_URL + '?connection_limit=20',
          },
        },
  
      })
    }
  
    async onModuleInit() {
      await this.$connect();
    }
  
    async enableShutdownHooks(app: INestApplication) {
      this.$on('beforeExit', async () =&gt; {
        await app.close();
      });
    }
  }```
  </code></pre>