Skip to content

Commit f45599d

Browse files
committed
test(sample): add required file test
ensure sample 29 controller throws an error when a file is required but none is given
1 parent e9aa1ca commit f45599d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ describe('E2E FileTest', () => {
5151
.expect(400);
5252
});
5353

54+
it('should throw when file is required but no file is uploaded', async () => {
55+
return request(app.getHttpServer())
56+
.post('/file/fail-validation')
57+
.send()
58+
.expect(400);
59+
});
60+
5461
it('should allow for optional file uploads with validation enabled (fixes #10017)', () => {
5562
return request(app.getHttpServer())
5663
.post('/file/pass-validation')

0 commit comments

Comments
 (0)