@@ -183,6 +183,10 @@ tape.test("with --null-semantics, optional fields are handled correctly in proto
183
183
184
184
test . error ( err , 'static code generation worked' ) ;
185
185
186
+ test . ok ( jsCode . includes ( "@property {OptionalFields.ISubMessage|null|undefined} [a] OptionalFields a" ) , "Property for a should use an interface" )
187
+ test . ok ( jsCode . includes ( "@member {OptionalFields.SubMessage|null} a" ) , "Member for a should use a message type" )
188
+ test . ok ( jsCode . includes ( "OptionalFields.prototype.a = null;" ) , "Initializer for a should be null" )
189
+
186
190
test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
187
191
test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
188
192
test . ok ( jsCode . includes ( "OptionalFields.prototype.c = null;" ) , "Initializer for c should be null" )
@@ -215,6 +219,10 @@ tape.test("with --null-semantics, optional fields are handled correctly in proto
215
219
216
220
test . error ( err , 'static code generation worked' ) ;
217
221
222
+ test . ok ( jsCode . includes ( "@property {OptionalFields.ISubMessage|null|undefined} [a] OptionalFields a" ) , "Property for a should use an interface" )
223
+ test . ok ( jsCode . includes ( "@member {OptionalFields.SubMessage|null} a" ) , "Member for a should use a message type" )
224
+ test . ok ( jsCode . includes ( "OptionalFields.prototype.a = null;" ) , "Initializer for a should be null" )
225
+
218
226
test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
219
227
test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
220
228
test . ok ( jsCode . includes ( "OptionalFields.prototype.c = null;" ) , "Initializer for c should be null" )
0 commit comments