From 1c52f44d8759a0abde3545e4ce34649c2ca19e44 Mon Sep 17 00:00:00 2001 From: Mateusz Mrowiec Date: Wed, 6 Dec 2017 07:26:24 +0100 Subject: [PATCH] Add clearUploadsDir --- test/fileLimitUploads.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/fileLimitUploads.spec.js b/test/fileLimitUploads.spec.js index 852319f..c1278ef 100644 --- a/test/fileLimitUploads.spec.js +++ b/test/fileLimitUploads.spec.js @@ -6,12 +6,15 @@ const server = require('./server'); const app = server.setup({ limits: {fileSize: 200 * 1024} // set 200kb upload limit }); +const clearUploadsDir = server.clearUploadsDir; const fileDir = server.fileDir; describe('Test Single File Upload With File Size Limit', function() { it(`upload 'basketball.png' (~154kb) with 200kb size limit`, function(done) { let filePath = path.join(fileDir, 'basketball.png'); + clearUploadsDir(); + request(app) .post('/upload/single') .attach('testFile', filePath) @@ -22,6 +25,8 @@ describe('Test Single File Upload With File Size Limit', function() { it(`fail when uploading 'car.png' (~269kb) with 200kb size limit`, function(done) { let filePath = path.join(fileDir, 'car.png'); + clearUploadsDir(); + request(app) .post('/upload/single') .attach('testFile', filePath)