1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-08 16:17:40 +00:00
This commit is contained in:
konradpabjan 2020-01-31 22:57:27 -05:00
parent 31ff9e6173
commit c5216d212f

View file

@ -317,15 +317,13 @@ describe('Upload Tests', () => {
*/
jest
.spyOn(HttpClient.prototype, 'sendStream')
.mockImplementation(async (verb, requestUrl, stream) => {
.mockImplementation(async (verb, requestUrl) => {
const mockMessage = new http.IncomingMessage(new net.Socket())
mockMessage.statusCode = 200
if (!stream.readable) {
throw new Error('Unable to read provided stream')
}
if (requestUrl.includes('fail')) {
mockMessage.statusCode = 500
}
return new Promise<HttpClientResponse>(resolve => {
resolve({
message: mockMessage,