8000 Straggler style fix up · weisd/protobuf-javascript@e2a0651 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2a0651

Browse files
committed
Straggler style fix up
1 parent bc27e85 commit e2a0651

File tree

5 files changed

+98
-98
lines changed

5 files changed

+98
-98
lines changed

binary/proto_test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ function checkExtensions(msg) {
396396
}
397397

398398

399-
describe('protoBinaryTest', function() {
399+
describe('protoBinaryTest', () => {
400400
/**
401401
* Tests a basic serialization-deserializaton round-trip with all supported
402402
* field types (on the TestAllTypes message type).
403403
*/
404-
it('testRoundTrip', function() {
404+
it('testRoundTrip', () => {
405405
const msg = new proto.jspb.test.TestAllTypes();
406406
fillAllFields(msg);
407407
const encoded = msg.serializeBinary();
@@ -412,7 +412,7 @@ describe('protoBinaryTest', function() {
412412
/**
413413
* Test that base64 string and Uint8Array are interchangeable in bytes fields.
414414
*/
415-
it('testBytesFieldsGettersInterop', function() {
415+
it('testBytesFieldsGettersInterop', () => {
416416
let msg = new proto.jspb.test.TestAllTypes();
417417
// Set from a base64 string and check all the getters work.
418418
msg.setOptionalBytes(BYTES_B64);
@@ -437,7 +437,7 @@ describe('protoBinaryTest', function() {
437437
/**
438438
* Test that bytes setters will receive result of any of the getters.
439439
*/
440-
it('testBytesFieldsSettersInterop', function() {
440+
it('testBytesFieldsSettersInterop', () => {
441441
const msg = new proto.jspb.test.TestAllTypes();
442442
msg.setOptionalBytes(BYTES);
443443
expect(bytesCompare(msg.getOptionalBy 67E6 tes(), BYTES)).toBeTrue();
@@ -453,7 +453,7 @@ describe('protoBinaryTest', function() {
453453
/**
454454
* Test that bytes setters will receive result of any of the getters.
455455
*/
456-
it('testRepeatedBytesGetters', function() {
456+
it('testRepeatedBytesGetters', () => {
457457
const msg = new proto.jspb.test.TestAllTypes();
458458

459459
function assertGetters() {
@@ -575,7 +575,7 @@ describe('protoBinaryTest', function() {
575575
/**
576576
* Tests extension serialization and deserialization.
577577
*/
578-
it('testExtensions', function() {
578+
it('testExtensions', () => {
579579
const msg = new proto.jspb.test.TestExtendable();
580580
fillExtensions(msg);
581581
const encoded = msg.serializeBinary();
@@ -586,7 +586,7 @@ describe('protoBinaryTest', function() {
586586
/**
587587
* Tests that unknown extensions don't cause deserialization failure.
588588
*/
589-
it('testUnknownExtension', function() {
589+
it('testUnknownExtension', () => {
590590
const msg = new proto.jspb.test.TestExtendable();
591591
fillExtensions(msg);
592592
const writer = new jspb.BinaryWriter();
@@ -597,7 +597,7 @@ describe('protoBinaryTest', function() {
597597
checkExtensions(decoded);
598598
});
599599

600-
it('testAnyWellKnownType', function() {
600+
it('testAnyWellKnownType', () => {
601601
const any = new proto.google.protobuf.Any();
602602
const msg = new proto.jspb.test.TestAllTypes();
603603

binary/writer_test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,95 +49,95 @@ goog.require('jspb.utils');
4949
goog.requireType('jspb.BinaryMessage');
5050

5151

52-
describe('binaryWriterTest', function() {
52+
describe('binaryWriterTest', () => {
5353
/**
5454
* Verifies that misuse of the writer class triggers assertions.
5555
*/
56-
it('testWriteErrors', function() {
56+
it('testWriteErrors', () => {
5757
// Submessages with invalid field indices should assert.
5858
let writer = new jspb.BinaryWriter();
5959
const dummyMessage = /** @type {!jspb.BinaryMessage} */ ({});
6060

61-
expect(function() {
61+
expect(() => {
6262
writer.writeMessage(-1, dummyMessage, () => {});
6363
}).toThrow();
6464

6565
// Writing invalid field indices should assert.
6666
writer = new jspb.BinaryWriter();
67-
expect(function() {
67+
expect(() => {
6868
writer.writeUint64(-1, 1);
6969
}).toThrow();
7070

7171
// Writing out-of-range field values should assert.
7272
writer = new jspb.BinaryWriter();
7373

74-
expect(function() {
74+
expect(() => {
7575
writer.writeInt32(1, -Infinity);
7676
}).toThrow();
77-
expect(function() {
77+
expect(() => {
7878
writer.writeInt32(1, Infinity);
7979
}).toThrow();
8080

81-
expect(function() {
81+
expect(() => {
8282
writer.writeInt64(1, -Infinity);
8383
}).toThrow();
84-
expect(function() {
84+
expect(() => {
8585
writer.writeInt64(1, Infinity);
8686
}).toThrow();
8787

88-
expect(function() {
88+
expect(() => {
8989
writer.writeUint32(1, -1);
9090
}).toThrow();
91-
expect(function() {
91+
expect(() => {
9292
writer.writeUint32(1, Infinity);
9393
}).toThrow();
9494

95-
expect(function() {
95+
expect(() => {
9696
writer.writeUint64(1, -1);
9797
}).toThrow();
98-
expect(function() {
98+
expect(() => {
9999
writer.writeUint64(1, Infinity);
100100
}).toThrow();
101101

102-
expect(function() {
102+
expect(() => {
103103
writer.writeSint32(1, -Infinity);
104104
}).toThrow();
105-
expect(function() {
105+
expect(() => {
106106
writer.writeSint32(1, Infinity);
107107
}).toThrow();
108108

109-
expect(function() {
109+
expect(() => {
110110
writer.writeSint64(1, -Infinity);
111111
}).toThrow();
112-
expect(function() {
112+
expect(() => {
113113
writer.writeSint64(1, Infinity);
114114
}).toThrow();
115115

116-
expect(function() {
116+
expect(() => {
117117
writer.writeFixed32(1, -1);
118118
}).toThrow();
119-
expect(function() {
119+
expect(() => {
120120
writer.writeFixed32(1, Infinity);
121121
}).toThrow();
122122

123-
expect(function() {
123+
expect(() => {
124124
writer.writeFixed64(1, -1);
125125
}).toThrow();
126-
expect(function() {
126+
expect(() => {
127127
writer.writeFixed64(1, Infinity);
128128
}).toThrow();
129129

130-
expect(function() {
130+
expect(() => {
131131
writer.writeSfixed32(1, -Infinity);
132132
}).toThrow();
133-
expect(function() {
133+
expect(() => {
134134
writer.writeSfixed32(1, Infinity);
135135
}).toThrow();
136136

137-
expect(function() {
137+
expect(() => {
138138
writer.writeSfixed64(1, -Infinity);
139139
}).toThrow();
140-
expect(function() {
140+
expect(() => {
141141
writer.writeSfixed64(1, Infinity);
142142
}).toThrow();
143143
});
@@ -146,7 +146,7 @@ describe('binaryWriterTest', function() {
146146
/**
147147
* Basic test of retrieving the result as a Uint8Array buffer
148148
*/
149-
it('testGetResultBuffer', function() {
149+
it('testGetResultBuffer', () => {
150150
const expected = '0864120b48656c6c6f20776f726c641a0301020320c801';
151151

152152
const writer = new jspb.BinaryWriter();
@@ -163,7 +163,7 @@ describe('binaryWriterTest', function() {
163163
/**
164164
* Tests websafe encodings for base64 strings.
165165
*/
166-
it('testWebSafeOption', function() {
166+
it('testWebSafeOption', () => {
167167
const writer = new jspb.BinaryWriter() F440 ;
168168
writer.writeBytes(1, new Uint8Array([127]));
169169
expect('CgF/').toEqual(writer.getResultBase64String());
@@ -173,7 +173,7 @@ describe('binaryWriterTest', function() {
173173
goog.crypt.base64.Alphabet.WEBSAFE_NO_PADDING));
174174
});
175175

176-
it('writes split 64 fields', function() {
176+
it('writes split 64 fields', () => {
177177
const writer = new jspb.BinaryWriter();
178178
writer.writeSplitVarint64(1, 0x1, 0x2);
179179
writer.writeSplitVarint64(1, 0xFFFFFFFF, 0xFFFFFFFF);
@@ -243,7 +243,7 @@ describe('binaryWriterTest', function() {
243243
]);
244244
});
245245

246-
it('writes zigzag 64 fields', function() {
246+
it('writes zigzag 64 fields', () => {
247247
// Test cases directly from the protobuf dev guide.
248248
// https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
249249
const testCases = [
@@ -355,7 +355,7 @@ describe('binaryWriterTest', function() {
355355
}));
356356
});
357357

358-
it('writes float32 fields', function() {
358+
it('writes float32 fields', () => {
359359
const testCases = [
360360
0, 1, -1, jspb.BinaryConstants.FLOAT32_MIN,
361361
-jspb.BinaryConstants.FLOAT32_MIN, jspb.BinaryConstants.FLOAT32_MAX,
@@ -378,7 +378,7 @@ describe('binaryWriterTest', function() {
378378
});
379379
});
380380

381-
it('writes double fields', function() {
381+
it('writes double fields', () => {
382382
const testCases = [
383383
0, 1, -1, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER,
384384
Number.MAX_VALUE, Number.MIN_VALUE, jspb.BinaryConstants.FLOAT32_MIN,

commonjs/import_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ googleProtobuf.exportSymbol('jspb.Message', googleProtobuf.Message, global);
4040
var test7_pb = require('./test7/test7_pb');
4141
googleProtobuf.exportSymbol('proto.jspb.test.framing.FramingMessage', test7_pb.FramingMessage, global);
4242

43-
describe('Import test suite', function() {
44-
it('testImportedMessage', function() {
43+
describe('Import test suite', () => {
44+
it('testImportedMessage', () => {
4545
const framing1 = new proto.jspb.test.framing.FramingMessage([]);
4646
const framing2 = new proto.jspb.test.framing.FramingMessage([]);
4747
expect(framing1.toObject()).toEqual(framing2.toObject());

commonjs/strict_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ const global = Function('return this')();
3838
const test9_pb = require('./protos/test9_pb');
3939
const test10_pb = require('./protos/test10_pb');
4040

41-
describe('Strict test suite', function() {
42-
it('testImportedMessage', function() {
41+
describe('Strict test suite', () => {
42+
it('testImportedMessage', () => {
4343
const simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9()
4444
const simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9()
4545
expect(simple1.toObject()).toEqual(simple2.toObject());
4646
});
4747

48-
it('testGlobalScopePollution', function() {
48+
it('testGlobalScopePollution', () => {
4949
expect(global.jspb.exttest).toBeUndefined();
5050
});
5151

52-
describe('with imports', function() {
53-
it('testImportedMessage', function() {
52+
describe('with imports', () => {
53+
it('testImportedMessage', () => {
5454
const simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10()
5555
const simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10()
5656
expect(simple1.toObject()).toEqual(simple2.toObject());
5757
});
5858

59-
it('testGlobalScopePollution', function() {
59+
it('testGlobalScopePollution', () => {
6060
expect(global.jspb.exttest).toBeUndefined();
6161
});
6262
});

0 commit comments

Comments
 (0)
0