Skip to content

Commit 1c52f44

Browse files
author
Mateusz Mrowiec
committed
Add clearUploadsDir
1 parent 91d944f commit 1c52f44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/fileLimitUploads.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ const server = require('./server');
66
const app = server.setup({
77
limits: {fileSize: 200 * 1024} // set 200kb upload limit
88
});
9+
const clearUploadsDir = server.clearUploadsDir;
910
const fileDir = server.fileDir;
1011

1112
describe('Test Single File Upload With File Size Limit', function() {
1213
it(`upload 'basketball.png' (~154kb) with 200kb size limit`, function(done) {
1314
let filePath = path.join(fileDir, 'basketball.png');
1415

16+
clearUploadsDir();
17+
1518
request(app)
1619
.post('/upload/single')
1720
.attach('testFile', filePath)
@@ -22,6 +25,8 @@ describe('Test Single File Upload With File Size Limit', function() {
2225
it(`fail when uploading 'car.png' (~269kb) with 200kb size limit`, function(done) {
2326
let filePath = path.join(fileDir, 'car.png');
2427

28+
clearUploadsDir();
29+
2530
request(app)
2631
.post('/upload/single')
2732
.attach('testFile', filePath)

0 commit comments

Comments
 (0)