This commit is contained in:
Tatyana Kostromskaya
2023-10-04 15:33:15 +00:00
parent 774f139bef
commit f699b96ecf
9 changed files with 474 additions and 382 deletions

View File

@@ -1,6 +1,7 @@
import * as http from 'http'
import * as https from 'https'
import proxy from 'proxy'
import { ProxyServer, createProxy } from "proxy";
import { ProxyAgent, fetch as undiciFetch } from "undici";
// Default values are set when the module is imported, so we need to set proxy first.
const proxyUrl = 'http://127.0.0.1:8081'
@@ -16,7 +17,7 @@ describe('@actions/github', () => {
beforeAll(async () => {
// Start proxy server
proxyServer = proxy()
proxyServer = createProxy()
await new Promise<void>(resolve => {
const port = Number(proxyUrl.split(':')[2])
proxyServer.listen(port, () => resolve())

View File

@@ -1,5 +1,5 @@
import * as http from 'http'
import proxy from 'proxy'
import { createProxy } from 'proxy'
import {getOctokit} from '../src/github'
import {GitHub, getOctokitOptions} from '../src/utils'
@@ -12,7 +12,7 @@ describe('@actions/github', () => {
beforeAll(async () => {
// Start proxy server
proxyServer = proxy()
proxyServer = createProxy()
await new Promise<void>(resolve => {
const port = Number(proxyUrl.split(':')[2])
proxyServer.listen(port, () => resolve())