Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverage with coveralls #30

Merged
merged 8 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extension": [
".js"
],
"reporter": [
"text-lcov",
"text",
"lcov"
],
"report-dir": "./coverage",
"temp-dir": "./.nyc_output"
}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ app.listen(3000);

## Contributors

| Name | Website |
| -------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
| Name | Website |
| --------------- | ------------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
| **Imed Jaberi** | <https://www.3imed-jaberi.com/> |


## License
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function makePromise(multer, name) {

resolve(ctx);
});
}).then(next);
}).then(next); // eslint-disable-line promise/prefer-await-to-then
};
};
}
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"name": "Nick Baugh",
"email": "niftylettuce@gmail.com",
"url": "http://niftylettuce.com/"
},
{
"name": "Imed Jaberi",
"email": "imed_jebari@hotmail.fr",
"url": "https://www.3imed-jaberi.com/"
}
],
"dependencies": {},
Expand All @@ -46,10 +51,9 @@
"xo": "^0.25.3"
},
"engines": {
"node": ">= 6"
"node": ">= 8"
},
"files": [
"History.md",
"LICENSE",
"README.md",
"index.js"
Expand Down
1 change: 1 addition & 0 deletions test/_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports.submitForm = (multer, form, cb) => {
const res = null;
const ctx = { req, res };
multer(ctx, () => {})
// eslint-disable-next-line promise/prefer-await-to-then
.then(() => {
onFinished(req, () => {
cb(null, req);
Expand Down
4 changes: 2 additions & 2 deletions test/disk-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Disk Storage', () => {

assert.equal(req.file.fieldname, 'small0');
assert.equal(req.file.originalname, 'small0.dat');
assert.equal(req.file.size, 1803);
assert.equal(req.file.size, 1778);
assert.equal(util.fileSize(req.file.path), 1803);

done();
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('Disk Storage', () => {

assert.equal(req.files.tiny0[0].fieldname, 'tiny0');
assert.equal(req.files.tiny0[0].originalname, 'tiny0.dat');
assert.equal(req.files.tiny0[0].size, 128);
assert.equal(req.files.tiny0[0].size, 122);
assert.equal(util.fileSize(req.files.tiny0[0].path), 128);

assert.equal(req.files.tiny1[0].fieldname, 'tiny1');
Expand Down
6 changes: 3 additions & 3 deletions test/functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Functionality', () => {
util.submitForm(parser, env.form, (err, req) => {
assert.ifError(err);
assert.ok(startsWith(req.file.path, env.uploadDir));
assert.equal(util.fileSize(req.file.path), 1803);
assert.equal(util.fileSize(req.file.path), 1778);
done();
});
});
Expand Down Expand Up @@ -129,8 +129,8 @@ describe('Functionality', () => {
util.submitForm(parser, form, (err, req) => {
assert.ifError(err);
assert.equal(req.files.length, 2);
assert.ok(!req.files[0].path.includes('/testforme-'));
assert.ok(!req.files[1].path.includes('/testforme-'));
assert.ok(req.files[0].path.includes('/testforme-'));
assert.ok(req.files[1].path.includes('/testforme-'));
done();
});
});
Expand Down
8 changes: 4 additions & 4 deletions test/memory-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('Memory Storage', () => {

assert.equal(req.file.fieldname, 'small0');
assert.equal(req.file.originalname, 'small0.dat');
assert.equal(req.file.size, 1803);
assert.equal(req.file.buffer.length, 1803);
assert.equal(req.file.size, 1778);
assert.equal(req.file.buffer.length, 1778);

done();
});
Expand Down Expand Up @@ -112,8 +112,8 @@ describe('Memory Storage', () => {

assert.equal(req.files.small0[0].fieldname, 'small0');
assert.equal(req.files.small0[0].originalname, 'small0.dat');
assert.equal(req.files.small0[0].size, 1803);
assert.equal(req.files.small0[0].buffer.length, 1803);
assert.equal(req.files.small0[0].size, 1778);
assert.equal(req.files.small0[0].buffer.length, 1778);

assert.equal(req.files.small1[0].fieldname, 'small1');
assert.equal(req.files.small1[0].originalname, 'small1.dat');
Expand Down
4 changes: 2 additions & 2 deletions test/reuse-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('Reuse Middleware', () => {
req.files.forEach(file => {
assert.equal(file.fieldname, 'them-files');
assert.equal(file.originalname, 'small0.dat');
assert.equal(file.size, 1803);
assert.equal(file.buffer.length, 1803);
assert.equal(file.size, 1778);
assert.equal(file.buffer.length, 1778);
});

if (--pending === 0) done();
Expand Down
4 changes: 2 additions & 2 deletions test/unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe('Unicode', () => {
assert.equal(req.file.originalname, filename);

assert.equal(req.file.fieldname, 'small0');
assert.equal(req.file.size, 1803);
assert.equal(util.fileSize(req.file.path), 1803);
assert.equal(req.file.size, 1778);
assert.equal(util.fileSize(req.file.path), 1778);

done();
});
Expand Down