From 451e81f171583acc4a17154277bd4769889ae460 Mon Sep 17 00:00:00 2001 From: Ignacio Aldama Vicente Date: Thu, 18 Jan 2024 16:24:21 +0100 Subject: [PATCH] style: revert auto-formatting --- .../proxy-agent.strict-ssl.spec.ts | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/network/proxy-agent/proxy-agent.strict-ssl.spec.ts b/network/proxy-agent/proxy-agent.strict-ssl.spec.ts index ad6c7b3..7a08b13 100644 --- a/network/proxy-agent/proxy-agent.strict-ssl.spec.ts +++ b/network/proxy-agent/proxy-agent.strict-ssl.spec.ts @@ -1,38 +1,36 @@ -import fetch from "node-fetch"; -import { getProxyAgent } from "./proxy-agent"; -import Proxy from "proxy"; +import fetch from 'node-fetch' +import { getProxyAgent } from './proxy-agent' +import Proxy from 'proxy' -describe("untrusted certificate", () => { - let proxy: Proxy; - let proxyPort: number; - beforeAll((done) => { - // setup HTTP proxy server - proxy = Proxy(); - proxy.listen(() => { - proxyPort = proxy.address().port; - done(); - }); - }); - afterAll((done) => { - proxy.once("close", done); - proxy.close(); - }); - it("should not throw an error if strictSsl is set to false", async () => { - const url = "https://self-signed.badssl.com"; - const agent: any = getProxyAgent(url, { - httpsProxy: `http://127.0.0.1:${proxyPort}`, - strictSsl: false, - }); - await fetch(url, { agent }); - }); - it("should throw an error if strictSsl is not set", async () => { - const url = "https://self-signed.badssl.com"; - const agent: any = getProxyAgent(url, { - httpsProxy: `http://127.0.0.1:${proxyPort}`, - strictSsl: true, - }); - await expect(fetch(url, { agent })).rejects.toThrow( - /self[- ]signed certificate/, - ); - }); -}); +describe('untrusted certificate', () => { + let proxy: Proxy + let proxyPort: number + beforeAll((done) => { + // setup HTTP proxy server + proxy = Proxy(); + proxy.listen(() => { + proxyPort = proxy.address().port; + done(); + }); + }); + afterAll((done) => { + proxy.once('close', done); + proxy.close(); + }); + it('should not throw an error if strictSsl is set to false', async () => { + const url = 'https://self-signed.badssl.com' + const agent: any = getProxyAgent(url, { + httpsProxy: `http://127.0.0.1:${proxyPort}`, + strictSsl: false, + }) + await fetch(url, { agent }) + }) + it('should throw an error if strictSsl is not set', async () => { + const url = 'https://self-signed.badssl.com' + const agent: any = getProxyAgent(url, { + httpsProxy: `http://127.0.0.1:${proxyPort}`, + strictSsl: true, + }) + await expect(fetch(url, { agent })).rejects.toThrow(/self[- ]signed certificate/) + }) +}) \ No newline at end of file