Skip to content

Commit

Permalink
fixed remaining lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgirges committed Aug 28, 2017
1 parent 9bf6e61 commit 1d13af9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
3 changes: 2 additions & 1 deletion test/manual/manualtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ app.post('/upload', function(req, res) {
uploadPath = __dirname + '/uploads/' + sampleFile.name;

sampleFile.mv(uploadPath, function(err) {
if (err)
if (err) {
return res.status(500).send(err);
}

res.send('File uploaded to ' + uploadPath);
});
Expand Down
3 changes: 2 additions & 1 deletion test/multipartFields.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ describe('Test Multipart Form Array Field Submissions', function() {
req
.expect(200)
.end(function(err, res) {
if (err)
if (err) {
return done(err);
}

let responseMatchesRequest = res.body.join(',') === mockCars.join(',');

Expand Down
24 changes: 16 additions & 8 deletions test/multipartUploads.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ describe('Test Single File Upload', function() {
.attach('testFile', filePath)
.expect(200)
.end(function(err, res) {
if (err)
if (err) {
return done(err);
}

fs.stat(uploadedFilePath, done);
});
Expand All @@ -64,8 +65,9 @@ describe('Test Single File Upload', function() {
.attach('testFile', filePath)
.expect(200)
.end(function(err, res) {
if (err)
if (err) {
return done(err);
}

fs.stat(uploadedFilePath, done);
});
Expand Down Expand Up @@ -115,16 +117,19 @@ describe('Test Multi-File Upload', function() {
.attach('testFile3', upload3)
.expect(200)
.end(function(err, res) {
if (err)
if (err) {
return done(err);
}

fs.stat(upload1, function(err) {
if (err)
if (err) {
return done(err);
}

fs.stat(upload2, function(err) {
if (err)
if (err) {
return done(err);
}

fs.stat(upload3, done);
});
Expand All @@ -146,8 +151,9 @@ describe('Test File Array Upload', function() {
req
.expect(200)
.end(function(err, res) {
if (err)
if (err) {
return done(err);
}

for (let i = 0; i < mockFiles.length; i++) {
fs.statSync(path.join(uploadDir, mockFiles[i]));
Expand Down Expand Up @@ -180,8 +186,9 @@ describe('Test Upload With Fields', function() {
email: mockUser.email
},
function(err, res) {
if (err)
if (err) {
return done(err);
}

fs.stat(uploadedFilePath, done);
});
Expand All @@ -205,8 +212,9 @@ describe('Test Upload With Fields', function() {
email: mockUser.email
},
function(err, res) {
if (err)
if (err) {
return done(err);
}

fs.stat(uploadedFilePath, done);
});
Expand Down
9 changes: 5 additions & 4 deletions test/options.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ describe('File Upload Options Tests', function() {
* @param {function} done The mocha continuation function.
*/
function executeFileUploadTestWalk(options,
actualFileNameToUpload,
expectedFileNameOnFileSystem,
done) {
actualFileNameToUpload,
expectedFileNameOnFileSystem,
done) {
request(server.setup(options))
.post('/upload/single')
.attach('testFile', path.join(fileDir, actualFileNameToUpload))
.expect(200)
.end(function(err) {
if (err)
if (err) {
return done(err);
}

const uploadedFilePath = path.join(uploadDir, expectedFileNameOnFileSystem);

Expand Down

0 comments on commit 1d13af9

Please sign in to comment.