@@ -276,14 +276,14 @@ describe('mergeMessage', () => {
276276 expect ( deprecatedOptions ) . toHaveLength ( 1 ) ;
277277 } ) ;
278278
279- it ( 'should keep fields with @grpc_only comment without deprecating' , ( ) => {
279+ it ( 'should keep fields with tooling_skip option without deprecating' , ( ) => {
280280 const source : ProtoMessage = {
281281 name : 'TestMessage' ,
282282 fields : [ {
283- name : 'grpc_field ' ,
283+ name : 'skip_field ' ,
284284 type : 'string' ,
285285 number : 1 ,
286- comment : '@grpc_only'
286+ annotations : [ { name : '(tooling_skip)' , value : 'true' } ]
287287 } , {
288288 name : 'normal_field' ,
289289 type : 'string' ,
@@ -301,21 +301,22 @@ describe('mergeMessage', () => {
301301
302302 const result = mergeMessage ( source , upcoming ) ;
303303
304- // grpc_field should remain without deprecated annotation
304+ // skip_field should remain without deprecated annotation added
305305 expect ( result . fields ) . toHaveLength ( 2 ) ;
306- const grpcField = result . fields . find ( f => f . name === 'grpc_field' ) ;
307- expect ( grpcField ) . toBeDefined ( ) ;
308- expect ( grpcField ! . annotations ) . toBeUndefined ( ) ;
306+ const skipField = result . fields . find ( f => f . name === 'skip_field' ) ;
307+ expect ( skipField ) . toBeDefined ( ) ;
308+ // Should only have tooling_skip, not deprecated
309+ expect ( skipField ! . annotations ) . not . toContainEqual ( { name : 'deprecated' , value : 'true' } ) ;
309310 } ) ;
310311
311- it ( 'should not report @grpc_only fields as deprecated' , ( ) => {
312+ it ( 'should not report tooling_skip fields as deprecated' , ( ) => {
312313 const source : ProtoMessage = {
313314 name : 'TestMessage' ,
314315 fields : [ {
315- name : 'grpc_field ' ,
316+ name : 'skip_field ' ,
316317 type : 'string' ,
317318 number : 1 ,
318- comment : '@grpc_only'
319+ annotations : [ { name : '(tooling_skip)' , value : 'true' } ]
319320 } ]
320321 } ;
321322 const upcoming : ProtoMessage = {
@@ -327,18 +328,18 @@ describe('mergeMessage', () => {
327328 mergeMessage ( source , upcoming , reporter ) ;
328329
329330 const markdown = reporter . toMarkdown ( ) ;
330- // Should not report deprecation for @grpc_only fields
331+ // Should not report deprecation for tooling_skip fields
331332 expect ( markdown ) . toContain ( 'No changes detected' ) ;
332333 } ) ;
333334
334- it ( 'should keep @grpc_only field if it exists in upcoming' , ( ) => {
335+ it ( 'should keep tooling_skip field if it exists in upcoming' , ( ) => {
335336 const source : ProtoMessage = {
336337 name : 'TestMessage' ,
337338 fields : [ {
338339 name : 'field_name' ,
339340 type : 'string' ,
340341 number : 1 ,
341- comment : '@grpc_only'
342+ annotations : [ { name : '(tooling_skip)' , value : 'true' } ]
342343 } ]
343344 } ;
344345 const upcoming : ProtoMessage = {
@@ -356,18 +357,18 @@ describe('mergeMessage', () => {
356357 expect ( result . fields [ 0 ] . name ) . toBe ( 'field_name' ) ;
357358 } ) ;
358359
359- it ( 'should assign new field number after max including @grpc_only field' , ( ) => {
360+ it ( 'should assign new field number after max including tooling_skip field' , ( ) => {
360361 const source : ProtoMessage = {
361362 name : 'TestMessage' ,
362363 fields : [ {
363364 name : 'existing_field' ,
364365 type : 'string' ,
365366 number : 1
366367 } , {
367- name : 'grpc_field ' ,
368+ name : 'skip_field ' ,
368369 type : 'string' ,
369370 number : 5 , // This is the max field number
370- comment : '@grpc_only'
371+ annotations : [ { name : '(tooling_skip)' , value : 'true' } ]
371372 } ]
372373 } ;
373374 const upcoming : ProtoMessage = {
@@ -385,9 +386,9 @@ describe('mergeMessage', () => {
385386
386387 const result = mergeMessage ( source , upcoming ) ;
387388
388- // grpc_field is kept, new_field is added
389+ // skip_field is kept, new_field is added
389390 expect ( result . fields ) . toHaveLength ( 3 ) ;
390- expect ( result . fields . find ( f => f . name === 'grpc_field ' ) ) . toBeDefined ( ) ;
391+ expect ( result . fields . find ( f => f . name === 'skip_field ' ) ) . toBeDefined ( ) ;
391392
392393 const newField = result . fields . find ( f => f . name === 'new_field' ) ;
393394 expect ( newField ) . toBeDefined ( ) ;
0 commit comments