@@ -11,7 +11,7 @@ describe('VSOClient Units', function () {
1111 let rest : rm . RestClient ;
1212 let vsoClient : vsom . VsoClient
1313 const baseUrl : string = 'https://dev.azure.com/' ;
14-
14+
1515 before ( ( ) => {
1616 const userAgent : string = "testAgent" ;
1717 rest = new rm . RestClient ( userAgent , null , [ ] ) ;
@@ -162,6 +162,27 @@ describe('VSOClient Units', function () {
162162 assert . equal ( res . requestUrl , 'https://dev.azure.com/testTemplate?status.innerstatus=2&version=1&nestedObject.nestedField=value&nestedObject.innerNestedObject.key=val2' ) ;
163163 } ) ;
164164
165+ it ( 'gets versioning datafor dates' , async ( ) => {
166+ //Arrange
167+ nock ( 'https://dev.azure.com/_apis/testArea5' , {
168+ reqheaders : {
169+ 'accept' : 'application/json' ,
170+ 'user-agent' : 'testAgent'
171+ } } )
172+ . options ( '' )
173+ . reply ( 200 , {
174+ value : [ { id : 'testLocation' , maxVersion : '1' , releasedVersion : '1' , routeTemplate : 'testTemplate' , area : 'testArea5' , resourceName : 'testName' , resourceVersion : '1' } ]
175+ } ) ;
176+
177+ //Act
178+ const queryParams = { min : new Date ( Date . UTC ( 208 , 9 , 19 ) ) } ;
179+ const res : vsom . ClientVersioningData = await vsoClient . getVersioningData ( '1' , 'testArea5' , 'testLocation' , { 'testKey' : 'testValue' } , queryParams ) ;
180+
181+ //Assert
182+ assert . equal ( res . apiVersion , '1' ) ;
183+ assert . equal ( res . requestUrl , 'https://dev.azure.com/testTemplate?min=Wed%2C%2019%20Oct%200208%2000%3A00%3A00%20GMT' ) ;
184+ } ) ;
185+
165186 it ( 'gets versioning data after an initialization promise' , async ( ) => {
166187 //Arrange
167188 nock ( 'https://newbase.com/_apis/testArea6' , {
@@ -207,7 +228,7 @@ describe('VSOClient Units', function () {
207228} ) ;
208229
209230describe ( 'WebApi Units' , function ( ) {
210- const osName : string = os . platform ( ) ;
231+ const osName : string = os . platform ( ) ;
211232 const osVersion : string = os . release ( ) ;
212233 const nodeApiName : string = 'azure-devops-node-api' ;
213234 const nodeApiVersion : string = JSON . parse ( fs . readFileSync ( 'package.json' , 'utf8' ) ) . version ;
@@ -245,7 +266,7 @@ describe('WebApi Units', function () {
245266 // Assert
246267 assert . equal ( res . apiVersion , '1' ) ;
247268 assert . equal ( res . requestUrl , 'https://dev.azure.com/testTemplate' ) ;
248-
269+
249270 } ) ;
250271
251272 it ( 'connects to the server with the correct user agent when request settings are not specified' , async ( ) => {
@@ -273,8 +294,8 @@ describe('WebApi Units', function () {
273294 it ( 'supports no_proxy environment variable' , async ( ) => {
274295 const myWebApi : WebApi . WebApi = new WebApi . WebApi ( 'https://dev.azure.com/' , WebApi . getBasicHandler ( 'user' , 'password' ) , null ) ;
275296 process . env . no_proxy = 'dev.azure.com,my-tfs-instance.host'
276- assert . equal ( myWebApi . isNoProxyHost ( 'https://dev.azure.com/myproject' ) , true ) ;
277- assert . equal ( myWebApi . isNoProxyHost ( 'https://my-tfs-instance.host/myproject' ) , true ) ;
297+ assert . equal ( myWebApi . isNoProxyHost ( 'https://dev.azure.com/myproject' ) , true ) ;
298+ assert . equal ( myWebApi . isNoProxyHost ( 'https://my-tfs-instance.host/myproject' ) , true ) ;
278299 assert . equal ( myWebApi . isNoProxyHost ( 'https://my-other-tfs-instance.host/myproject' ) , false ) ;
279300 } ) ;
280301} ) ;
0 commit comments