Skip to content

Commit 14baad6

Browse files
author
Danny McCormick
committed
Use https in tests
1 parent f279e0f commit 14baad6

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

test/units/toolTests.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert = require('assert');
1+
import assert = require('assert');
22
import path = require('path');
33
import fs = require('fs');
44
import nock = require ('nock');
@@ -16,7 +16,7 @@ let tempPath = path.join(process.cwd(), 'TEMP');
1616

1717
describe('Tool Tests', function () {
1818
before(function () {
19-
nock('http://microsoft.com')
19+
nock('https://microsoft.com')
2020
.persist()
2121
.get('/bytes/35')
2222
.reply(200, {
@@ -52,7 +52,7 @@ describe('Tool Tests', function () {
5252
it('downloads a 35 byte file', function () {
5353
return new Promise<void>(async (resolve, reject) => {
5454
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");
5656
toolLib.debug('downloaded path: ' + downPath);
5757

5858
assert(tl.exist(downPath), 'downloaded file exists');
@@ -67,10 +67,10 @@ describe('Tool Tests', function () {
6767
});
6868

6969
it('downloads a 35 byte file after a redirect', function () {
70-
nock('http://microsoft.com')
70+
nock('https://microsoft.com')
7171
.get('/redirect-to')
7272
.reply(303, undefined, {
73-
location:'http://microsoft.com/bytes/35'
73+
location:'https://microsoft.com/bytes/35'
7474
});
7575

7676
return new Promise<void>(async (resolve, reject) => {
@@ -133,14 +133,14 @@ describe('Tool Tests', function () {
133133
});
134134

135135
it('works with redirect code 302', async function () {
136-
nock('http://microsoft.com')
136+
nock('https://microsoft.com')
137137
.get('/redirect-to')
138138
.reply(302, undefined, {
139-
location:'http://microsoft.com/bytes/35'
139+
location:'https://microsoft.com/bytes/35'
140140
});
141141
return new Promise<void>(async(resolve, reject)=> {
142142
try {
143-
let statusCodeUrl: string = "http://microsoft.com/redirect-to";
143+
let statusCodeUrl: string = "https://microsoft.com/redirect-to";
144144
let downPath: string = await toolLib.downloadTool(statusCodeUrl);
145145

146146
resolve();
@@ -154,7 +154,7 @@ describe('Tool Tests', function () {
154154
it('installs a binary tool and finds it', function () {
155155
return new Promise<void>(async (resolve, reject) => {
156156
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");
158158
toolLib.debug('downloaded path: ' + downPath);
159159

160160
assert(tl.exist(downPath), 'downloaded file exists');
@@ -354,8 +354,8 @@ describe('Tool Tests', function () {
354354
it('finds and evaluates local tool version', function () {
355355
return new Promise<void>(async (resolve, reject) => {
356356
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");
359359

360360
toolLib.cacheFile(downPath1_1, 'foo', 'foo', '1.1.0');
361361
toolLib.cacheFile(downPath1_2, 'foo', 'foo', '1.2.0');
@@ -431,17 +431,17 @@ describe('Tool Tests', function () {
431431

432432
it("works with a 502 temporary failure", async function() {
433433
this.timeout(5000);
434-
nock('http://microsoft.com')
434+
nock('https://microsoft.com')
435435
.get('/temp502')
436436
.twice()
437437
.reply(502, undefined);
438-
nock('http://microsoft.com')
438+
nock('https://microsoft.com')
439439
.get('/temp502')
440440
.reply(200, undefined);
441441

442442
return new Promise<void>(async (resolve, reject) => {
443443
try {
444-
let statusCodeUrl: string = "http://microsoft.com/temp502";
444+
let statusCodeUrl: string = "https://microsoft.com/temp502";
445445
let downPath: string = await toolLib.downloadTool(statusCodeUrl);
446446

447447
resolve();
@@ -453,14 +453,14 @@ describe('Tool Tests', function () {
453453

454454
it("doesn't retry 502s more than 3 times", async function() {
455455
this.timeout(5000);
456-
nock('http://microsoft.com')
456+
nock('https://microsoft.com')
457457
.get('/perm502')
458458
.times(3)
459459
.reply(502, undefined);
460460

461461
return new Promise<void>(async (resolve, reject) => {
462462
try {
463-
let statusCodeUrl: string = "http://microsoft.com/perm502";
463+
let statusCodeUrl: string = "https://microsoft.com/perm502";
464464
let downPath: string = await toolLib.downloadTool(statusCodeUrl);
465465

466466
reject('Shouldnt have succeeded');

0 commit comments

Comments
 (0)