Skip to content

Commit 1ff9b58

Browse files
committed
fix lint
1 parent 9b7a982 commit 1ff9b58

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/helpers-test.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ class CustomError extends Error {
1616
}
1717
}
1818

19-
describe('winston-mongodb-helpers', function() {
20-
describe('#prepareMetaData()', function() {
21-
it('should preserve Date instances', function() {
19+
describe('winston-mongodb-helpers', function () {
20+
describe('#prepareMetaData()', function () {
21+
it('should preserve Date instances', function () {
2222
const originalData = { customDate: new Date() };
2323

2424
const preparedData = helpers.prepareMetaData(originalData);
2525

2626
assert(preparedData.customDate instanceof Date);
2727
assert.strictEqual(+preparedData.customDate, +originalData.customDate);
2828
});
29-
it('should store Error objects', function() {
29+
it('should store Error objects', function () {
3030
const originalData = { standardError: new Error('some error') };
3131

3232
const preparedData = helpers.prepareMetaData(originalData);
@@ -37,9 +37,9 @@ describe('winston-mongodb-helpers', function() {
3737
assert.strictEqual(preparedData.standardError.name, originalData.standardError.name);
3838
assert.strictEqual(preparedData.standardError.stack, originalData.standardError.stack);
3939
});
40-
it('should store extra fields for custom Error objects', function() {
40+
it('should store extra fields for custom Error objects', function () {
4141
const originalData = { customError: new CustomError() };
42-
42+
4343
const preparedData = helpers.prepareMetaData(originalData);
4444

4545
assert(preparedData.customError instanceof Object);
@@ -49,21 +49,21 @@ describe('winston-mongodb-helpers', function() {
4949
assert.strictEqual(preparedData.customError.stack, originalData.customError.stack);
5050
assert.strictEqual(preparedData.customError.testField, originalData.customError.testField);
5151
});
52-
it('should preserve ObjectIds', function() {
52+
it('should preserve ObjectIds', function () {
5353
const originalData = { objectId: new ObjectID() };
54-
54+
5555
const preparedData = helpers.prepareMetaData(originalData);
5656

5757
assert.strictEqual(preparedData.objectId, originalData.objectId);
5858
});
59-
it('should preserve Buffers', function() {
59+
it('should preserve Buffers', function () {
6060
const originalData = { buffer: new Buffer.from('test') };
61-
61+
6262
const preparedData = helpers.prepareMetaData(originalData);
6363

6464
assert.strictEqual(preparedData.buffer, originalData.buffer);
6565
});
66-
it('should handle objects containing all kinds of values, including arrays, nested objects and functions', function() {
66+
it('should handle objects containing all kinds of values, including arrays, nested objects and functions', function () {
6767
const originalData = {
6868
undefinedValue: undefined,
6969
nullValue: null,
@@ -79,10 +79,10 @@ describe('winston-mongodb-helpers', function() {
7979

8080
const preparedData = helpers.prepareMetaData(originalData);
8181

82-
const expected = { ...originalData, functionValue: {} }
82+
const expected = { ...originalData, functionValue: {}};
8383
assert.deepStrictEqual(preparedData, expected);
8484
});
85-
it('should handle arrays containing all kinds of values, including objects, nested arrays and functions', function() {
85+
it('should handle arrays containing all kinds of values, including objects, nested arrays and functions', function () {
8686
const originalData = [
8787
undefined,
8888
null,
@@ -102,15 +102,15 @@ describe('winston-mongodb-helpers', function() {
102102
expected[expected.length - 1] = {}; // function gets converted to empty object
103103
assert.deepStrictEqual(preparedData, expected);
104104
});
105-
it('should replace dots and dollar signs in object keys', function() {
105+
it('should replace dots and dollar signs in object keys', function () {
106106
const originalData = { 'key.with.dots': true, '$test$': true };
107-
107+
108108
const preparedData = helpers.prepareMetaData(originalData);
109109

110110
const expected = { 'key[dot]with[dot]dots': true, '[$]test[$]': true };
111111
assert.deepStrictEqual(preparedData, expected);
112112
});
113-
it('should break circular dependencies', function() {
113+
it('should break circular dependencies', function () {
114114
const originalData = {};
115115
originalData.nestedObjectValue = { nestedKey: originalData };
116116
originalData.arrayValue = [originalData, 'test', { nestedKey: originalData }];
@@ -124,10 +124,10 @@ describe('winston-mongodb-helpers', function() {
124124

125125
assert.deepStrictEqual(preparedData, expected);
126126
});
127-
it('should handle objects with null prototype', function() {
127+
it('should handle objects with null prototype', function () {
128128
const originalData = Object.create(null);
129129
originalData['key.with.dots'] = true;
130-
originalData['$test$'] = true;
130+
originalData.$test$ = true;
131131
originalData.nestedObjectValue = { nestedKey: originalData };
132132
originalData.arrayValue = [originalData, 'test', { nestedKey: originalData }];
133133

@@ -136,8 +136,8 @@ describe('winston-mongodb-helpers', function() {
136136
const expected = {
137137
'key[dot]with[dot]dots': true,
138138
'[$]test[$]': true,
139-
nestedObjectValue: { nestedKey: '[Circular]' },
140-
arrayValue: ['[Circular]', 'test', { nestedKey: '[Circular]' }]
139+
'nestedObjectValue': { nestedKey: '[Circular]' },
140+
'arrayValue': ['[Circular]', 'test', { nestedKey: '[Circular]' }]
141141
};
142142

143143
assert.deepStrictEqual(preparedData, expected);

0 commit comments

Comments
 (0)