Skip to content

Commit a8dc67f

Browse files
committed
Fixed linting errors
1 parent 3eee3ea commit a8dc67f

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"extends": "eslint:recommended",
88
"rules": {
9-
"strict": "error",
9+
"strict": "off",
1010
"callback-return": "warn",
1111
"global-require": "error",
1212
"new-cap": "warn",

test/errors.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Error handling', () => {
7777
it('should fail gracefully if an error is thrown inside the configuration function', function (done) {
7878
this.slow(200);
7979
let error;
80-
storage = GridFsStorage({
80+
storage = new GridFsStorage({
8181
url: settings.mongoUrl,
8282
file: () => {
8383
throw new Error('Error thrown');
@@ -106,7 +106,7 @@ describe('Error handling', () => {
106106
it('should fail gracefully if an error is thrown inside a generator function', function (done) {
107107
let error;
108108

109-
storage = GridFsStorage({
109+
storage = new GridFsStorage({
110110
url: settings.mongoUrl,
111111
file: function* () { // eslint-disable-line require-yield
112112
throw new Error('File error');
@@ -147,7 +147,7 @@ describe('Error handling', () => {
147147
setTimeout(() => reject(error), 200);
148148
});
149149

150-
storage = GridFsStorage({db: promise});
150+
storage = new GridFsStorage({db: promise});
151151

152152
const upload = multer({storage});
153153

@@ -190,7 +190,7 @@ describe('Error handling', () => {
190190
return db.close().then(() => db);
191191
})
192192
.then(db => {
193-
storage = GridFsStorage({db});
193+
storage = new GridFsStorage({db});
194194
const upload = multer({storage});
195195

196196
app.post('/close', upload.array('photos', 2), (err, req, res, next) => {
@@ -230,7 +230,7 @@ describe('Error handling', () => {
230230
it('should throw an error if the mongodb connection fails', function (done) {
231231
const connectionSpy = sinon.spy();
232232

233-
storage = GridFsStorage({
233+
storage = new GridFsStorage({
234234
url: settings.mongoUrl,
235235
});
236236

@@ -262,7 +262,7 @@ describe('Error handling', () => {
262262
throw generatedError;
263263
});
264264

265-
storage = GridFsStorage({
265+
storage = new GridFsStorage({
266266
url: settings.mongoUrl,
267267
});
268268

test/generators.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('ES6 generators', () => {
109109
before((done) => {
110110
parameters = [];
111111

112-
storage = GridFsStorage({
112+
storage = new GridFsStorage({
113113
url: setting.mongoUrl,
114114
file: function* (req, file) {
115115
let counter = 0;
@@ -161,7 +161,7 @@ describe('ES6 generators', () => {
161161
describe('promises and generators', () => {
162162
let result;
163163
before((done) => {
164-
storage = GridFsStorage({
164+
storage = new GridFsStorage({
165165
url: setting.mongoUrl,
166166
file: function* () {
167167
let counter = 0;
@@ -240,7 +240,7 @@ describe('ES6 generators', () => {
240240
describe('finite generators', () => {
241241
let error;
242242
before((done) => {
243-
storage = GridFsStorage({
243+
storage = new GridFsStorage({
244244
url: setting.mongoUrl,
245245
file: function* () {
246246
yield {
@@ -291,7 +291,7 @@ describe('ES6 generators', () => {
291291
describe('rejected promise', () => {
292292
let error;
293293
before((done) => {
294-
storage = GridFsStorage({
294+
storage = new GridFsStorage({
295295
url: setting.mongoUrl,
296296
file: function* () {
297297
yield Promise.reject('reason');

test/legacy.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ describe('Backwards compatibility', () => {
241241
},
242242
}),
243243
});
244-
storage = GridFsStorage({url: setting.mongoUrl});
244+
storage = new GridFsStorage({url: setting.mongoUrl});
245245
storage._legacy = true;
246246
storage.on('streamError', errorSpy);
247247
storage.on('file', fileSpy);
@@ -280,7 +280,7 @@ describe('Backwards compatibility', () => {
280280
before((done) => {
281281
emitterStub = sinon.stub().callsFake((evt, cb) => {
282282
if (evt === 'end') {
283-
cb();
283+
return cb();
284284
}
285285
});
286286
sinon.stub(mongo, 'GridStore').returns({
@@ -292,7 +292,7 @@ describe('Backwards compatibility', () => {
292292
},
293293
}),
294294
});
295-
storage = GridFsStorage({url: setting.mongoUrl});
295+
storage = new GridFsStorage({url: setting.mongoUrl});
296296
storage._legacy = true;
297297
storage.on('streamError', errorSpy);
298298
storage.on('file', fileSpy);
@@ -342,7 +342,7 @@ describe('Backwards compatibility', () => {
342342
}
343343
return Promise.resolve(db);
344344
});
345-
storage = GridFsStorage({url: setting.mongoUrl});
345+
storage = new GridFsStorage({url: setting.mongoUrl});
346346

347347
storage.on('connection', (db, client) => {
348348
expect(db).to.be.an.instanceOf(mongo.Db);
@@ -364,7 +364,7 @@ describe('Backwards compatibility', () => {
364364
}
365365
return Promise.resolve(client);
366366
});
367-
storage = GridFsStorage({url: setting.mongoUrl});
367+
storage = new GridFsStorage({url: setting.mongoUrl});
368368

369369
storage.on('connection', (db, client) => {
370370
expect(mongoSpy).to.have.callCount(1);

test/storage.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ describe('Storage', () => {
639639
},
640640
});
641641

642-
storage2 = GridFsStorage({
642+
storage2 = new GridFsStorage({
643643
url: settings.mongoUrl,
644644
connectionOpts: {
645645
poolSize: 10,

0 commit comments

Comments
 (0)