Skip to content

Commit dee3083

Browse files
Update tests for --null-semantics flag
1 parent bee997d commit dee3083

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/cli.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ tape.test("with null-defaults, absent optional fields have null values", functio
165165
});
166166

167167

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) {
169169
cliTest(test, function() {
170170
var root = protobuf.loadSync("tests/data/cli/null-defaults.proto");
171171
root.resolveAll();
@@ -178,13 +178,13 @@ tape.test("with force-optional, optional fields are handled correctly in proto2"
178178
encode: true,
179179
convert: true,
180180
comments: true,
181-
"force-optional": true,
181+
"null-semantics": true,
182182
}, function(err, jsCode) {
183183

184184
test.error(err, 'static code generation worked');
185185

186186
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")
188188
test.ok(jsCode.includes("OptionalFields.prototype.c = null;"), "Initializer for c should be null")
189189

190190
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"
197197
});
198198

199199

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) {
201201
cliTest(test, function() {
202202
var root = protobuf.loadSync("tests/data/cli/null-defaults-proto3.proto");
203203
root.resolveAll();
@@ -210,15 +210,13 @@ tape.test("with force-optional, optional fields are handled correctly in proto3"
210210
encode: true,
211211
convert: true,
212212
comments: true,
213-
"force-optional": true,
213+
"null-semantics": true,
214214
}, function(err, jsCode) {
215215

216-
console.log(jsCode);
217-
218216
test.error(err, 'static code generation worked');
219217

220218
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")
222220
test.ok(jsCode.includes("OptionalFields.prototype.c = null;"), "Initializer for c should be null")
223221

224222
test.ok(jsCode.includes("@property {number} d OptionalFields d"), "Property for d should not be nullable")

0 commit comments

Comments
 (0)