@@ -65,40 +65,34 @@ describe("CloudEvents Spec v1.0", () => {
65
65
66
66
describe ( "Extensions Constraints" , ( ) => {
67
67
it ( "should be ok when type is 'boolean'" , ( ) => {
68
- cloudevent = cloudevent . cloneWith ( { "ext-boolean" : true } ) ;
69
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
68
+ expect ( cloudevent . cloneWith ( { "ext-boolean" : true } ) . validate ( ) ) . to . equal ( true ) ;
70
69
} ) ;
71
70
72
71
it ( "should be ok when type is 'integer'" , ( ) => {
73
- cloudevent = cloudevent . cloneWith ( { "ext-integer" : 2019 } ) ;
74
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
72
+ expect ( cloudevent . cloneWith ( { "ext-integer" : 2019 } ) . validate ( ) ) . to . equal ( true ) ;
75
73
} ) ;
76
74
77
75
it ( "should be ok when type is 'string'" , ( ) => {
78
- cloudevent = cloudevent . cloneWith ( { "ext-string" : "an-string" } ) ;
79
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
76
+ expect ( cloudevent . cloneWith ( { "ext-string" : "an-string" } ) . validate ( ) ) . to . equal ( true ) ;
80
77
} ) ;
81
78
82
79
it ( "should be ok when type is 'Uint32Array' for 'Binary'" , ( ) => {
83
80
const myBinary = new Uint32Array ( 2019 ) ;
84
- cloudevent = cloudevent . cloneWith ( { "ext-binary" : myBinary } ) ;
85
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
81
+ expect ( cloudevent . cloneWith ( { "ext-binary" : myBinary } ) . validate ( ) ) . to . equal ( true ) ;
86
82
} ) ;
87
83
88
84
// URI
89
85
it ( "should be ok when type is 'Date' for 'Timestamp'" , ( ) => {
90
86
const myDate = new Date ( ) ;
91
- cloudevent = cloudevent . cloneWith ( { "ext-date" : myDate } ) ;
92
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
87
+ expect ( cloudevent . cloneWith ( { "ext-date" : myDate } ) . validate ( ) ) . to . equal ( true ) ;
93
88
} ) ;
94
89
95
90
// even though the spec doesn't allow object types for
96
91
// extensions, it could be JSON. And before a JS CE
97
92
// is transmitted across the wire, this value will be
98
93
// converted to JSON
99
94
it ( "should be ok when the type is an object" , ( ) => {
100
- cloudevent = cloudevent . cloneWith ( { "object-extension" : { some : "object" } } ) ;
101
- expect ( cloudevent . validate ( ) ) . to . equal ( true ) ;
95
+ expect ( cloudevent . cloneWith ( { "object-extension" : { some : "object" } } ) . validate ( ) ) . to . equal ( true ) ;
102
96
} ) ;
103
97
} ) ;
104
98
0 commit comments