5
5
// tslint:disable:no-floating-promises
6
6
7
7
import { HttpTransportType , IHttpConnectionOptions , TransferFormat } from "@microsoft/signalr" ;
8
- import { DEFAULT_TIMEOUT_INTERVAL , eachHttpClient , eachTransport , ECHOENDPOINT_URL } from "./Common" ;
8
+ import { DEFAULT_TIMEOUT_INTERVAL , eachHttpClient , eachTransport , ECHOENDPOINT_URL , HTTPS_ECHOENDPOINT_URL , shouldRunHttpsTests } from "./Common" ;
9
9
import { TestLogger } from "./TestLogger" ;
10
10
11
11
// We want to continue testing HttpConnection, but we don't export it anymore. So just pull it in directly from the source file.
@@ -15,6 +15,8 @@ import "./LogBannerReporter";
15
15
16
16
jasmine . DEFAULT_TIMEOUT_INTERVAL = DEFAULT_TIMEOUT_INTERVAL ;
17
17
18
+ const USED_ECHOENDPOINT_URL = shouldRunHttpsTests ? HTTPS_ECHOENDPOINT_URL : ECHOENDPOINT_URL ;
19
+
18
20
const commonOptions : IHttpConnectionOptions = {
19
21
logMessageContent : true ,
20
22
logger : TestLogger . instance ,
@@ -23,7 +25,7 @@ const commonOptions: IHttpConnectionOptions = {
23
25
describe ( "connection" , ( ) => {
24
26
it ( "can connect to the server without specifying transport explicitly" , ( done ) => {
25
27
const message = "Hello World!" ;
26
- const connection = new HttpConnection ( ECHOENDPOINT_URL , {
28
+ const connection = new HttpConnection ( USED_ECHOENDPOINT_URL , {
27
29
...commonOptions ,
28
30
} ) ;
29
31
@@ -53,7 +55,7 @@ describe("connection", () => {
53
55
const message = "Hello World!" ;
54
56
// the url should be resolved relative to the document.location.host
55
57
// and the leading '/' should be automatically added to the url
56
- const connection = new HttpConnection ( ECHOENDPOINT_URL , {
58
+ const connection = new HttpConnection ( USED_ECHOENDPOINT_URL , {
57
59
...commonOptions ,
58
60
httpClient,
59
61
transport : transportType ,
@@ -83,7 +85,7 @@ describe("connection", () => {
83
85
const message = "Hello World!" ;
84
86
85
87
// DON'T use commonOptions because we want to specifically test the scenario where logMessageContent is not set.
86
- const connection = new HttpConnection ( ECHOENDPOINT_URL , {
88
+ const connection = new HttpConnection ( USED_ECHOENDPOINT_URL , {
87
89
httpClient,
88
90
logger : TestLogger . instance ,
89
91
transport : transportType ,
@@ -119,7 +121,7 @@ describe("connection", () => {
119
121
const message = "Hello World!" ;
120
122
121
123
// DON'T use commonOptions because we want to specifically test the scenario where logMessageContent is set to true (even if commonOptions changes).
122
- const connection = new HttpConnection ( ECHOENDPOINT_URL , {
124
+ const connection = new HttpConnection ( USED_ECHOENDPOINT_URL , {
123
125
httpClient,
124
126
logMessageContent : true ,
125
127
logger : TestLogger . instance ,
@@ -167,7 +169,7 @@ describe("connection", () => {
167
169
const message = "Hello World!" ;
168
170
169
171
// The server will set some response headers for the '/negotiate' endpoint
170
- const connection = new HttpConnection ( ECHOENDPOINT_URL , {
172
+ const connection = new HttpConnection ( USED_ECHOENDPOINT_URL , {
171
173
...commonOptions ,
172
174
httpClient,
173
175
transport : transportType ,
0 commit comments