title: e2e test failed to run TypeError: mongoose.Schema is not a constructor
body: <blockquote>
    <p>When i run my test e2e, i get this message</p>
  
  <pre><code>Test suite failed to run
  
      TypeError: mongoose.Schema is not a constructor
  
        at Object.&lt;anonymous&gt; (../src/dbschema/test.schema.ts:2:43)
  
  Where test.schema file is:
  
      import * as mongoose from 'mongoose';
  
      export const TestSchema = new mongoose.Schema({
        id: {
          type: Number,
          required: true,
        },
      });
  
  Can somebody help me?
  </code></pre>
    
    <p>I bring more details: I would execute a e2e test with using nestjs
    framework this is the code: 
        import request from 'supertest';
        import { Test } from '@nestjs/testing';
        import { INestApplication } from '@nestjs/common';
        import { GameModule } from '../src/game/game.module';</p>
  
  <pre><code>describe('Games', () =&gt; {
    let app: INestApplication;
  
    beforeAll(async () =&gt; {
      const module = await Test.createTestingModule({
        imports: [GameModule],
      })
        .compile();
  
      app = await module.createNestApplication();
      await app.init();
    });
  
   The TestSchema is used in an other schema which is GameSchema 
  
  import * as mongoose from 'mongoose';
  import { TestSchema } from './test.schema';
  
  export const GameSchema = new mongoose.Schema({
  price: {
      type: PriceSchema,
      required: true,
    },
  });
  </code></pre>
  </blockquote>