@@ -131,16 +131,6 @@ describe("Session", () => {
131
131
return expect ( ( await headers ) . get ( "ftrack-strict-api" ) ) . toEqual ( "true" ) ;
132
132
} ) ;
133
133
134
- it ( "Should allow querying with datetimes decoded as dayjs objects (default)" , async ( ) => {
135
- const result = await session . query (
136
- "select name, created_at from Task limit 1" ,
137
- ) ;
138
- expect ( result . data [ 0 ] . created_at ) . toBeInstanceOf ( dayjs ) ;
139
- expect ( result . data [ 0 ] . created_at . toISOString ( ) ) . toEqual (
140
- "2022-10-10T10:12:09.000Z" ,
141
- ) ;
142
- } ) ;
143
-
144
134
it ( "Should allow querying with datetimes decoded as ISO objects" , async ( ) => {
145
135
const result = await session . query (
146
136
"select name, created_at from Task limit 1" ,
@@ -163,30 +153,6 @@ describe("Session", () => {
163
153
) ;
164
154
expect ( result . data [ 0 ] . created_at ) . toEqual ( "2022-10-10T10:12:09.000Z" ) ;
165
155
} ) ;
166
- it ( "Should allow overriding session decodeDatesAsIso when querying" , async ( ) => {
167
- const decodeDatesAsIsoSession = new Session (
168
- credentials . serverUrl ,
169
- credentials . apiUser ,
170
- credentials . apiKey ,
171
- {
172
- decodeDatesAsIso : true ,
173
- } ,
174
- ) ;
175
- await decodeDatesAsIsoSession . initializing ;
176
- const result = await decodeDatesAsIsoSession . query (
177
- "select name, created_at from Task limit 1" ,
178
- { decodeDatesAsIso : false } ,
179
- ) ;
180
- expect ( result . data [ 0 ] . created_at ) . toBeInstanceOf ( dayjs ) ;
181
- expect ( result . data [ 0 ] . created_at . toISOString ( ) ) . toEqual (
182
- "2022-10-10T10:12:09.000Z" ,
183
- ) ;
184
- const result2 = await session . query (
185
- "select name, created_at from Task limit 1" ,
186
- { decodeDatesAsIso : true } ,
187
- ) ;
188
- expect ( result2 . data [ 0 ] . created_at ) . toEqual ( "2022-10-10T10:12:09.000Z" ) ;
189
- } ) ;
190
156
191
157
it ( "Should allow querying with datetimes decoded as ISO objects with timezone support disabled" , async ( ) => {
192
158
server . use (
@@ -837,20 +803,6 @@ describe("Encoding entities", () => {
837
803
expect ( data [ 2 ] . status . state . short ) . toEqual ( "DONE" ) ;
838
804
} ) ;
839
805
840
- it ( "Should support decoding datetime as dayjs (default)" , ( ) => {
841
- const now = dayjs ( ) ;
842
-
843
- //@ts -ignore - Otherwise internal method used for testing purposes
844
- const output = session . decode ( {
845
- foo : {
846
- __type__ : "datetime" ,
847
- value : now . toISOString ( ) ,
848
- } ,
849
- } ) ;
850
- expect ( output . foo ) . toBeInstanceOf ( dayjs ) ;
851
- expect ( output . foo . toISOString ( ) ) . toEqual ( now . toISOString ( ) ) ;
852
- } ) ;
853
-
854
806
it ( "Should support decoding datetime as ISO string" , ( ) => {
855
807
const now = new Date ( ) ;
856
808
0 commit comments