Skip to content

Commit 0b07780

Browse files
committed
fix: remove unused e2e test
1 parent 5243fca commit 0b07780

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

sample/29-file-upload/e2e/app/app.e2e-spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ describe('E2E FileTest', () => {
4343
});
4444
});
4545

46-
it('should allow for file uploads that pass validation without using magic numbers validation', async () => {
47-
return request(app.getHttpServer())
48-
.post('/file/pass-validation-skip-magic-numbers-validation')
49-
.attach('file', './package.json')
50-
.field('name', 'test')
51-
.expect(201)
52-
.expect({
53-
body: {
54-
name: 'test',
55-
},
56-
file: readFileSync('./package.json').toString(),
57-
});
58-
});
59-
6046
it('should throw for file uploads that do not pass validation', async () => {
6147
return request(app.getHttpServer())
6248
.post('/file/fail-validation')

sample/29-file-upload/src/app.controller.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,6 @@ export class AppController {
5454
};
5555
}
5656

57-
@UseInterceptors(FileInterceptor('file'))
58-
@Post('file/pass-validation-skip-magic-numbers-validation')
59-
uploadFileAndPassValidationWithoutMagicNumbersValidation(
60-
@Body() body: SampleDto,
61-
@UploadedFile(
62-
new ParseFilePipeBuilder()
63-
.addFileTypeValidator({
64-
fileType: 'json',
65-
skipMagicNumbersValidation: true,
66-
})
67-
.build({
68-
fileIsRequired: false,
69-
}),
70-
)
71-
file?: Express.Multer.File,
72-
) {
73-
return {
74-
body,
75-
file: file?.buffer.toString(),
76-
};
77-
}
78-
7957
@UseInterceptors(FileInterceptor('file'))
8058
@Post('file/fail-validation')
8159
uploadFileAndFailValidation(

0 commit comments

Comments
 (0)