79275672

Date: 2024-12-12 15:29:49
Score: 2.5
Natty:
Report link

I don't see the whole test but I assume that you have something like this:

let app: INestApplication;

beforeEach(async () => {
    const module = await Test.createTestingModule({ imports: [AppModule] })
        .compile();

    app = module.createNestApplication();
    // etc..
});

If so, the graphqlUpload middleware won't be added to your application created during test. As I can see you add it in bootstrap tho, so that may explain why it works outside tests.

If my guess is correct you should add middleware to your test too. For example:

let app: INestApplication;

beforeEach(async () => {
    const module = await Test.createTestingModule({ imports: [AppModule] })
        .compile();

    app = module.createNestApplication();
    app.use(graphqlUploadExpress({ maxFileSize: 5242880, maxFiles: 10 }))

    // etc..
});

If it won't help could you please share implementation of integrationTestManager.getServerInstance()?

Reasons:
  • RegEx Blacklisted phrase (2.5): could you please share
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: Kishieel