[Snyk] Upgrade winston from 3.2.1 to 3.3.2 (#6799)

* fix: upgrade winston from 3.2.1 to 3.3.2

Snyk has created this PR to upgrade winston from 3.2.1 to 3.3.2.

See this package in NPM:
https://www.npmjs.com/package/winston

See this project in Snyk:
https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr

* fix tests

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
This commit is contained in:
Snyk bot
2020-08-21 02:06:36 +03:00
committed by GitHub
parent d87dac1d09
commit bff0ea96b8
3 changed files with 99 additions and 67 deletions

View File

@@ -24,7 +24,7 @@ const mockAdapter = {
// Small additional tests to improve overall coverage
describe('FilesController', () => {
it('should properly expand objects', (done) => {
it('should properly expand objects', done => {
const config = Config.get(Parse.applicationId);
const gridStoreAdapter = new GridFSBucketAdapter(
'mongodb://localhost:27017/parse'
@@ -48,7 +48,7 @@ describe('FilesController', () => {
done();
});
it('should create a server log on failure', (done) => {
it('should create a server log on failure', done => {
const logController = new LoggerController(new WinstonLoggerAdapter());
reconfigureServer({ filesAdapter: mockAdapter })
@@ -57,20 +57,20 @@ describe('FilesController', () => {
() => done.fail('should not succeed'),
() => setImmediate(() => Promise.resolve('done'))
)
.then(() => new Promise((resolve) => setTimeout(resolve, 200)))
.then(() => new Promise(resolve => setTimeout(resolve, 200)))
.then(() =>
logController.getLogs({ from: Date.now() - 1000, size: 1000 })
)
.then((logs) => {
.then(logs => {
// we get two logs here: 1. the source of the failure to save the file
// and 2 the message that will be sent back to the client.
const log1 = logs.find(
(x) => x.message === 'Error creating a file: it failed with xyz'
x => x.message === 'Error creating a file: it failed with xyz'
);
expect(log1.level).toBe('error');
const log2 = logs.find((x) => x.message === 'it failed with xyz');
const log2 = logs.find(x => x.message === 'it failed with xyz');
expect(log2.level).toBe('error');
expect(log2.code).toBe(130);
@@ -78,7 +78,7 @@ describe('FilesController', () => {
});
});
it('should create a parse error when a string is returned', (done) => {
it('should create a parse error when a string is returned', done => {
const mock2 = mockAdapter;
mock2.validateFilename = () => {
return 'Bad file! No biscuit!';
@@ -91,7 +91,7 @@ describe('FilesController', () => {
done();
});
it('should add a unique hash to the file name when the preserveFileName option is false', (done) => {
it('should add a unique hash to the file name when the preserveFileName option is false', done => {
const config = Config.get(Parse.applicationId);
const gridStoreAdapter = new GridFSBucketAdapter(
'mongodb://localhost:27017/parse'
@@ -114,7 +114,7 @@ describe('FilesController', () => {
done();
});
it('should not add a unique hash to the file name when the preserveFileName option is true', (done) => {
it('should not add a unique hash to the file name when the preserveFileName option is true', done => {
const config = Config.get(Parse.applicationId);
const gridStoreAdapter = new GridFSBucketAdapter(
'mongodb://localhost:27017/parse'
@@ -145,7 +145,7 @@ describe('FilesController', () => {
expect(result).toEqual({});
});
it('should reject slashes in file names', (done) => {
it('should reject slashes in file names', done => {
const gridStoreAdapter = new GridFSBucketAdapter(
'mongodb://localhost:27017/parse'
);
@@ -154,7 +154,7 @@ describe('FilesController', () => {
done();
});
it('should also reject slashes in file names', (done) => {
it('should also reject slashes in file names', done => {
const gridStoreAdapter = new GridStoreAdapter(
'mongodb://localhost:27017/parse'
);