@@ -183,6 +183,10 @@ tape.test("with --null-semantics, optional fields are handled correctly in proto
183183
184184 test . error ( err , 'static code generation worked' ) ;
185185
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+
186190 test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
187191 test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
188192 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
215219
216220 test . error ( err , 'static code generation worked' ) ;
217221
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+
218226 test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
219227 test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
220228 test . ok ( jsCode . includes ( "OptionalFields.prototype.c = null;" ) , "Initializer for c should be null" )
0 commit comments