@@ -165,7 +165,7 @@ tape.test("with null-defaults, absent optional fields have null values", functio
165
165
} ) ;
166
166
167
167
168
- tape . test ( "with force-optional , optional fields are handled correctly in proto2" , function ( test ) {
168
+ tape . test ( "with --null-semantics , optional fields are handled correctly in proto2" , function ( test ) {
169
169
cliTest ( test , function ( ) {
170
170
var root = protobuf . loadSync ( "tests/data/cli/null-defaults.proto" ) ;
171
171
root . resolveAll ( ) ;
@@ -178,13 +178,13 @@ tape.test("with force-optional, optional fields are handled correctly in proto2"
178
178
encode : true ,
179
179
convert : true ,
180
180
comments : true ,
181
- "force-optional " : true ,
181
+ "null-semantics " : true ,
182
182
} , function ( err , jsCode ) {
183
183
184
184
test . error ( err , 'static code generation worked' ) ;
185
185
186
186
test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
187
- test . ok ( jsCode . includes ( "@member {number|null|undefined } c" ) , "Member for c should be nullable" )
187
+ test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
188
188
test . ok ( jsCode . includes ( "OptionalFields.prototype.c = null;" ) , "Initializer for c should be null" )
189
189
190
190
test . ok ( jsCode . includes ( "@property {number} d OptionalFields d" ) , "Property for d should not be nullable" )
@@ -197,7 +197,7 @@ tape.test("with force-optional, optional fields are handled correctly in proto2"
197
197
} ) ;
198
198
199
199
200
- tape . test ( "with force-optional , optional fields are handled correctly in proto3" , function ( test ) {
200
+ tape . test ( "with --null-semantics , optional fields are handled correctly in proto3" , function ( test ) {
201
201
cliTest ( test , function ( ) {
202
202
var root = protobuf . loadSync ( "tests/data/cli/null-defaults-proto3.proto" ) ;
203
203
root . resolveAll ( ) ;
@@ -210,15 +210,13 @@ tape.test("with force-optional, optional fields are handled correctly in proto3"
210
210
encode : true ,
211
211
convert : true ,
212
212
comments : true ,
213
- "force-optional " : true ,
213
+ "null-semantics " : true ,
214
214
} , function ( err , jsCode ) {
215
215
216
- console . log ( jsCode ) ;
217
-
218
216
test . error ( err , 'static code generation worked' ) ;
219
217
220
218
test . ok ( jsCode . includes ( "@property {number|null|undefined} [c] OptionalFields c" ) , "Property for c should be nullable" )
221
- test . ok ( jsCode . includes ( "@member {number|null|undefined } c" ) , "Member for c should be nullable" )
219
+ test . ok ( jsCode . includes ( "@member {number|null} c" ) , "Member for c should be nullable" )
222
220
test . ok ( jsCode . includes ( "OptionalFields.prototype.c = null;" ) , "Initializer for c should be null" )
223
221
224
222
test . ok ( jsCode . includes ( "@property {number} d OptionalFields d" ) , "Property for d should not be nullable" )
0 commit comments