1
- import assert = require( 'assert' ) ;
1
+ import assert = require( 'assert' ) ;
2
2
import path = require( 'path' ) ;
3
3
import fs = require( 'fs' ) ;
4
4
import nock = require ( 'nock' ) ;
@@ -16,7 +16,7 @@ let tempPath = path.join(process.cwd(), 'TEMP');
16
16
17
17
describe ( 'Tool Tests' , function ( ) {
18
18
before ( function ( ) {
19
- nock ( 'http ://microsoft.com' )
19
+ nock ( 'https ://microsoft.com' )
20
20
. persist ( )
21
21
. get ( '/bytes/35' )
22
22
. reply ( 200 , {
@@ -52,7 +52,7 @@ describe('Tool Tests', function () {
52
52
it ( 'downloads a 35 byte file' , function ( ) {
53
53
return new Promise < void > ( async ( resolve , reject ) => {
54
54
try {
55
- let downPath : string = await toolLib . downloadTool ( "http ://microsoft.com/bytes/35" ) ;
55
+ let downPath : string = await toolLib . downloadTool ( "https ://microsoft.com/bytes/35" ) ;
56
56
toolLib . debug ( 'downloaded path: ' + downPath ) ;
57
57
58
58
assert ( tl . exist ( downPath ) , 'downloaded file exists' ) ;
@@ -67,10 +67,10 @@ describe('Tool Tests', function () {
67
67
} ) ;
68
68
69
69
it ( 'downloads a 35 byte file after a redirect' , function ( ) {
70
- nock ( 'http ://microsoft.com' )
70
+ nock ( 'https ://microsoft.com' )
71
71
. get ( '/redirect-to' )
72
72
. reply ( 303 , undefined , {
73
- location :'http ://microsoft.com/bytes/35'
73
+ location :'https ://microsoft.com/bytes/35'
74
74
} ) ;
75
75
76
76
return new Promise < void > ( async ( resolve , reject ) => {
@@ -133,14 +133,14 @@ describe('Tool Tests', function () {
133
133
} ) ;
134
134
135
135
it ( 'works with redirect code 302' , async function ( ) {
136
- nock ( 'http ://microsoft.com' )
136
+ nock ( 'https ://microsoft.com' )
137
137
. get ( '/redirect-to' )
138
138
. reply ( 302 , undefined , {
139
- location :'http ://microsoft.com/bytes/35'
139
+ location :'https ://microsoft.com/bytes/35'
140
140
} ) ;
141
141
return new Promise < void > ( async ( resolve , reject ) => {
142
142
try {
143
- let statusCodeUrl : string = "http ://microsoft.com/redirect-to" ;
143
+ let statusCodeUrl : string = "https ://microsoft.com/redirect-to" ;
144
144
let downPath : string = await toolLib . downloadTool ( statusCodeUrl ) ;
145
145
146
146
resolve ( ) ;
@@ -154,7 +154,7 @@ describe('Tool Tests', function () {
154
154
it ( 'installs a binary tool and finds it' , function ( ) {
155
155
return new Promise < void > ( async ( resolve , reject ) => {
156
156
try {
157
- let downPath : string = await toolLib . downloadTool ( "http ://microsoft.com/bytes/35" ) ;
157
+ let downPath : string = await toolLib . downloadTool ( "https ://microsoft.com/bytes/35" ) ;
158
158
toolLib . debug ( 'downloaded path: ' + downPath ) ;
159
159
160
160
assert ( tl . exist ( downPath ) , 'downloaded file exists' ) ;
@@ -354,8 +354,8 @@ describe('Tool Tests', function () {
354
354
it ( 'finds and evaluates local tool version' , function ( ) {
355
355
return new Promise < void > ( async ( resolve , reject ) => {
356
356
try {
357
- let downPath1_1 : string = await toolLib . downloadTool ( "http ://microsoft.com/bytes/35" ) ;
358
- let downPath1_2 : string = await toolLib . downloadTool ( "http ://microsoft.com/bytes/35" ) ;
357
+ let downPath1_1 : string = await toolLib . downloadTool ( "https ://microsoft.com/bytes/35" ) ;
358
+ let downPath1_2 : string = await toolLib . downloadTool ( "https ://microsoft.com/bytes/35" ) ;
359
359
360
360
toolLib . cacheFile ( downPath1_1 , 'foo' , 'foo' , '1.1.0' ) ;
361
361
toolLib . cacheFile ( downPath1_2 , 'foo' , 'foo' , '1.2.0' ) ;
@@ -431,17 +431,17 @@ describe('Tool Tests', function () {
431
431
432
432
it ( "works with a 502 temporary failure" , async function ( ) {
433
433
this . timeout ( 5000 ) ;
434
- nock ( 'http ://microsoft.com' )
434
+ nock ( 'https ://microsoft.com' )
435
435
. get ( '/temp502' )
436
436
. twice ( )
437
437
. reply ( 502 , undefined ) ;
438
- nock ( 'http ://microsoft.com' )
438
+ nock ( 'https ://microsoft.com' )
439
439
. get ( '/temp502' )
440
440
. reply ( 200 , undefined ) ;
441
441
442
442
return new Promise < void > ( async ( resolve , reject ) => {
443
443
try {
444
- let statusCodeUrl : string = "http ://microsoft.com/temp502" ;
444
+ let statusCodeUrl : string = "https ://microsoft.com/temp502" ;
445
445
let downPath : string = await toolLib . downloadTool ( statusCodeUrl ) ;
446
446
447
447
resolve ( ) ;
@@ -453,14 +453,14 @@ describe('Tool Tests', function () {
453
453
454
454
it ( "doesn't retry 502s more than 3 times" , async function ( ) {
455
455
this . timeout ( 5000 ) ;
456
- nock ( 'http ://microsoft.com' )
456
+ nock ( 'https ://microsoft.com' )
457
457
. get ( '/perm502' )
458
458
. times ( 3 )
459
459
. reply ( 502 , undefined ) ;
460
460
461
461
return new Promise < void > ( async ( resolve , reject ) => {
462
462
try {
463
- let statusCodeUrl : string = "http ://microsoft.com/perm502" ;
463
+ let statusCodeUrl : string = "https ://microsoft.com/perm502" ;
464
464
let downPath : string = await toolLib . downloadTool ( statusCodeUrl ) ;
465
465
466
466
reject ( 'Shouldnt have succeeded' ) ;
0 commit comments