Skip to content

Commit 483b008

Browse files
committed
Fix test and format code
1 parent 4ea4fb6 commit 483b008

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/__tests__/terminalCloudAPI.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { syncRefund, syncRes, syncResEventNotification, syncResEventNotification
55
import Client from "../client";
66
import TerminalCloudAPI from "../services/terminalCloudAPI";
77
import { terminal } from "../typings";
8+
import { EnvironmentEnum } from "../config";
89

910
let client: Client;
1011
let terminalCloudAPI: TerminalCloudAPI;
@@ -139,7 +140,7 @@ describe("Terminal Cloud API", (): void => {
139140

140141
const terminalApiHost = "https://terminal-api-test.adyen.com";
141142

142-
const client = new Client({ apiKey: "YOUR_API_KEY", environment: "TEST" });
143+
const client = new Client({ apiKey: "YOUR_API_KEY", environment: EnvironmentEnum.TEST });
143144
const terminalCloudAPI = new TerminalCloudAPI(client);
144145

145146
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
@@ -166,7 +167,7 @@ describe("Terminal Cloud API", (): void => {
166167
test("sync should validate 308 location header", async (): Promise<void> => {
167168
const terminalApiHost = "https://terminal-api-test.adyen.com";
168169

169-
const client = new Client({ apiKey: "YOUR_API_KEY", environment: "TEST" });
170+
const client = new Client({ apiKey: "YOUR_API_KEY", environment: EnvironmentEnum.TEST });
170171
const terminalCloudAPI = new TerminalCloudAPI(client);
171172

172173
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();

src/httpClient/httpURLConnectionClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class HttpURLConnectionClient implements ClientInterface {
175175

176176
// Handle 308 redirect
177177
if (res.statusCode && res.statusCode === 308) {
178-
const location = res.headers['location'];
178+
const location = res.headers["location"];
179179
if (location) {
180180
// follow the redirect
181181
try {
@@ -189,7 +189,7 @@ class HttpURLConnectionClient implements ClientInterface {
189189

190190
const newRequestOptions = {
191191
hostname: url.hostname,
192-
port: url.port || (url.protocol === 'https:' ? 443 : 80),
192+
port: url.port || (url.protocol === "https:" ? 443 : 80),
193193
path: url.pathname + url.search,
194194
method: connectionRequest.method,
195195
headers: connectionRequest.getHeaders(),

0 commit comments

Comments
 (0)