1
0
Fork 0

udpating proxy call

pull/1477/head
Vallie Joseph 2023-07-31 20:33:04 +00:00
parent 7a78c830aa
commit a3d9e7703a
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
// eslint-disable-next-line filenames/match-regex
import * as http from 'http'
import * as https from 'https'
import proxy from 'proxy'
import { createProxy } from 'proxy';
// 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(http.createServer());
await new Promise(resolve => {
const port = Number(proxyUrl.split(':')[2])
proxyServer.listen(port, () => resolve('mockResolve'))