Skip to content

Commit bff0ea9

Browse files
snyk-botdplewis
andauthored
[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 <[email protected]>
1 parent d87dac1 commit bff0ea9

File tree

3 files changed

+99
-67
lines changed

3 files changed

+99
-67
lines changed

package-lock.json

Lines changed: 87 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"subscriptions-transport-ws": "0.9.17",
5555
"tv4": "1.3.0",
5656
"uuid": "8.3.0",
57-
"winston": "3.2.1",
57+
"winston": "3.3.2",
5858
"winston-daily-rotate-file": "4.5.0",
5959
"ws": "7.3.1"
6060
},

spec/FilesController.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const mockAdapter = {
2424

2525
// Small additional tests to improve overall coverage
2626
describe('FilesController', () => {
27-
it('should properly expand objects', (done) => {
27+
it('should properly expand objects', done => {
2828
const config = Config.get(Parse.applicationId);
2929
const gridStoreAdapter = new GridFSBucketAdapter(
3030
'mongodb://localhost:27017/parse'
@@ -48,7 +48,7 @@ describe('FilesController', () => {
4848
done();
4949
});
5050

51-
it('should create a server log on failure', (done) => {
51+
it('should create a server log on failure', done => {
5252
const logController = new LoggerController(new WinstonLoggerAdapter());
5353

5454
reconfigureServer({ filesAdapter: mockAdapter })
@@ -57,28 +57,28 @@ describe('FilesController', () => {
5757
() => done.fail('should not succeed'),
5858
() => setImmediate(() => Promise.resolve('done'))
5959
)
60-
.then(() => new Promise((resolve) => setTimeout(resolve, 200)))
60+
.then(() => new Promise(resolve => setTimeout(resolve, 200)))
6161
.then(() =>
6262
logController.getLogs({ from: Date.now() - 1000, size: 1000 })
6363
)
64-
.then((logs) => {
64+
.then(logs => {
6565
// we get two logs here: 1. the source of the failure to save the file
6666
// and 2 the message that will be sent back to the client.
6767

6868
const log1 = logs.find(
69-
(x) => x.message === 'Error creating a file: it failed with xyz'
69+
x => x.message === 'Error creating a file: it failed with xyz'
7070
);
7171
expect(log1.level).toBe('error');
7272

73-
const log2 = logs.find((x) => x.message === 'it failed with xyz');
73+
const log2 = logs.find(x => x.message === 'it failed with xyz');
7474
expect(log2.level).toBe('error');
7575
expect(log2.code).toBe(130);
7676

7777
done();
7878
});
7979
});
8080

81-
it('should create a parse error when a string is returned', (done) => {
81+
it('should create a parse error when a string is returned', done => {
8282
const mock2 = mockAdapter;
8383
mock2.validateFilename = () => {
8484
return 'Bad file! No biscuit!';
@@ -91,7 +91,7 @@ describe('FilesController', () => {
9191
done();
9292
});
9393

94-
it('should add a unique hash to the file name when the preserveFileName option is false', (done) => {
94+
it('should add a unique hash to the file name when the preserveFileName option is false', done => {
9595
const config = Config.get(Parse.applicationId);
9696
const gridStoreAdapter = new GridFSBucketAdapter(
9797
'mongodb://localhost:27017/parse'
@@ -114,7 +114,7 @@ describe('FilesController', () => {
114114
done();
115115
});
116116

117-
it('should not add a unique hash to the file name when the preserveFileName option is true', (done) => {
117+
it('should not add a unique hash to the file name when the preserveFileName option is true', done => {
118118
const config = Config.get(Parse.applicationId);
119119
const gridStoreAdapter = new GridFSBucketAdapter(
120120
'mongodb://localhost:27017/parse'
@@ -145,7 +145,7 @@ describe('FilesController', () => {
145145
expect(result).toEqual({});
146146
});
147147

148-
it('should reject slashes in file names', (done) => {
148+
it('should reject slashes in file names', done => {
149149
const gridStoreAdapter = new GridFSBucketAdapter(
150150
'mongodb://localhost:27017/parse'
151151
);
@@ -154,7 +154,7 @@ describe('FilesController', () => {
154154
done();
155155
});
156156

157-
it('should also reject slashes in file names', (done) => {
157+
it('should also reject slashes in file names', done => {
158158
const gridStoreAdapter = new GridStoreAdapter(
159159
'mongodb://localhost:27017/parse'
160160
);

0 commit comments

Comments
 (0)