@@ -62,11 +62,11 @@ describe("JsonParseNode", () => {
62
62
it ( "Test enum serialization" , async ( ) => {
63
63
const inputObject : TestParser = {
64
64
status : LongRunningOperationStatusObject . NotStarted ,
65
- nextStatuses : [ LongRunningOperationStatusObject . Succeeded , LongRunningOperationStatusObject . Failed ] ,
65
+ // nextStatuses: [LongRunningOperationStatusObject.Succeeded, LongRunningOperationStatusObject.Failed],
66
66
} ;
67
67
const expectedObject : TestParser = {
68
68
status : LongRunningOperationStatusObject . NotStarted ,
69
- nextStatuses : [ LongRunningOperationStatusObject . Succeeded , LongRunningOperationStatusObject . Failed ] ,
69
+ // nextStatuses: [LongRunningOperationStatusObject.Succeeded, LongRunningOperationStatusObject.Failed],
70
70
} ;
71
71
72
72
const writer = new JsonSerializationWriter ( ) ;
@@ -79,6 +79,17 @@ describe("JsonParseNode", () => {
79
79
assert . deepEqual ( stringValueResult , expectedObject ) ;
80
80
} ) ;
81
81
82
+ it ( "Test collection of enum serialization" , async ( ) => {
83
+ const writer = new JsonSerializationWriter ( ) ;
84
+ const enums = [ LongRunningOperationStatusObject . NotStarted , LongRunningOperationStatusObject . Succeeded ] ;
85
+
86
+ writer . writeCollectionOfEnumValue ( "enum" , enums ) ;
87
+ const serializedContent = writer . getSerializedContent ( ) ;
88
+ const decoder = new TextDecoder ( ) ;
89
+ const contentAsStr = decoder . decode ( serializedContent ) ;
90
+ assert . equal ( contentAsStr , '"enum":["notStarted","succeeded"],' ) ;
91
+ } ) ;
92
+
82
93
it ( "encodes characters properly" , async ( ) => {
83
94
const inputObject : TestParser = {
84
95
testCollection : [ "2" , "3" ] ,
0 commit comments