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

[Snyk] Upgrade winston from 3.2.1 to 3.3.2 #6799

Merged
4 commits merged into from
Aug 20, 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
142 changes: 87 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"subscriptions-transport-ws": "0.9.17",
"tv4": "1.3.0",
"uuid": "8.3.0",
"winston": "3.2.1",
"winston": "3.3.2",
"winston-daily-rotate-file": "4.5.0",
"ws": "7.3.1"
},
Expand Down
22 changes: 11 additions & 11 deletions spec/FilesController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 })
Expand All @@ -57,28 +57,28 @@ 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);

done();
});
});

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!';
Expand All @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
);
Expand All @@ -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'
);
Expand Down