summaryrefslogtreecommitdiff
path: root/node_modules/global-tunnel-ng/test/end-to-end.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/global-tunnel-ng/test/end-to-end.js
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/global-tunnel-ng/test/end-to-end.js')
-rw-r--r--node_modules/global-tunnel-ng/test/end-to-end.js71
1 files changed, 0 insertions, 71 deletions
diff --git a/node_modules/global-tunnel-ng/test/end-to-end.js b/node_modules/global-tunnel-ng/test/end-to-end.js
deleted file mode 100644
index be91f7d..0000000
--- a/node_modules/global-tunnel-ng/test/end-to-end.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Use this tests for troubleshooting, you'll need a proxy runnig at an endpoint
-// The idea is to make sure the tests pass if the proxy is turned on, that means the requests are resolving
-// And also the tests should fail if the proxy is turned off, that means the requests are actually being proxied
-
-const globalTunnel = require('../index');
-const assert = require('chai').assert;
-const request = require('request');
-const http = require('http');
-const https = require('https');
-
-// You need to have a proxy running at the Proxy URL.
-const proxyUrl = 'http://localhost:8080';
-const resourceUrl = 'www.google.com';
-
-describe.skip('end-to-end tests', () => {
- beforeEach(() => {
- globalTunnel.initialize(proxyUrl);
- });
-
- const httpResourceUrl = (secure = false) => `http${secure ? 's' : ''}://${resourceUrl}`;
-
- const testHttp = (httpMethod = 'request') => (secure = false) => () =>
- new Promise((resolve, reject) => {
- const request = (secure ? https : http)[httpMethod](
- httpResourceUrl(secure),
- response => {
- assert.isAtLeast(response.statusCode, 200);
- assert.isBelow(response.statusCode, 300);
-
- let buffer = Buffer.alloc(0);
-
- response.on('data', chunk => {
- buffer = Buffer.concat([buffer, chunk]);
- });
- response.on('end', () => {
- assert.isNotEmpty(buffer.toString());
- resolve();
- });
- }
- );
-
- request.on('error', reject);
-
- if (httpMethod === 'request') {
- request.end();
- }
- });
-
- const testHttpRequest = testHttp();
- const testHttpGet = testHttp('get');
-
- it('proxies http.get', testHttpGet());
- it('proxies https.get', testHttpGet(true));
- it('proxies http.request', testHttpRequest());
- it('proxies https.request', testHttpRequest(true));
-
- it('proxies request', () =>
- new Promise((resolve, reject) => {
- request.get({ url: httpResourceUrl(true) }, err => {
- if (err) {
- reject(err);
- } else {
- resolve();
- }
- });
- }));
-
- afterEach(() => {
- globalTunnel.end();
- });
-});