mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix: remove unused e2e test
This commit is contained in:
@@ -43,20 +43,6 @@ describe('E2E FileTest', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should allow for file uploads that pass validation without using magic numbers validation', async () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/file/pass-validation-skip-magic-numbers-validation')
|
||||
.attach('file', './package.json')
|
||||
.field('name', 'test')
|
||||
.expect(201)
|
||||
.expect({
|
||||
body: {
|
||||
name: 'test',
|
||||
},
|
||||
file: readFileSync('./package.json').toString(),
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw for file uploads that do not pass validation', async () => {
|
||||
return request(app.getHttpServer())
|
||||
.post('/file/fail-validation')
|
||||
|
||||
@@ -54,28 +54,6 @@ export class AppController {
|
||||
};
|
||||
}
|
||||
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
@Post('file/pass-validation-skip-magic-numbers-validation')
|
||||
uploadFileAndPassValidationWithoutMagicNumbersValidation(
|
||||
@Body() body: SampleDto,
|
||||
@UploadedFile(
|
||||
new ParseFilePipeBuilder()
|
||||
.addFileTypeValidator({
|
||||
fileType: 'json',
|
||||
skipMagicNumbersValidation: true,
|
||||
})
|
||||
.build({
|
||||
fileIsRequired: false,
|
||||
}),
|
||||
)
|
||||
file?: Express.Multer.File,
|
||||
) {
|
||||
return {
|
||||
body,
|
||||
file: file?.buffer.toString(),
|
||||
};
|
||||
}
|
||||
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
@Post('file/fail-validation')
|
||||
uploadFileAndFailValidation(
|
||||
|
||||
Reference in New Issue
Block a user