mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 07:17:04 +02:00
Fix pipeline
This commit is contained in:
parent
326d2cdbe0
commit
2bef7fdbfb
|
|
@ -33,6 +33,10 @@ import {
|
|||
} from '../request-helper-functions';
|
||||
|
||||
const TEST_CA_CERT = '-----BEGIN CERTIFICATE-----\nTEST\n-----END CERTIFICATE-----';
|
||||
type RedirectResponseDetails = Parameters<
|
||||
NonNullable<Awaited<ReturnType<typeof parseRequestObject>>['beforeRedirect']>
|
||||
>[1];
|
||||
const redirectResponseDetails: RedirectResponseDetails = { headers: {}, statusCode: 302 };
|
||||
|
||||
describe('Request Helper Functions', () => {
|
||||
describe('proxyRequestToAxios', () => {
|
||||
|
|
@ -501,7 +505,7 @@ describe('Request Helper Functions', () => {
|
|||
hostname: 'example.de',
|
||||
href: requestObject.uri,
|
||||
};
|
||||
axiosOptions.beforeRedirect!(redirectOptions, mock(), mock());
|
||||
axiosOptions.beforeRedirect!(redirectOptions, redirectResponseDetails);
|
||||
expect(redirectOptions.agent).toEqual(redirectOptions.agents.https);
|
||||
expect((redirectOptions.agent as HttpsAgent).options).toMatchObject({
|
||||
servername: 'example.de',
|
||||
|
|
@ -2240,9 +2244,9 @@ describe('Request Helper Functions', () => {
|
|||
};
|
||||
|
||||
expect(axiosOptions.beforeRedirect).toBeDefined();
|
||||
expect(() => axiosOptions.beforeRedirect!(redirectOptions, mock(), mock())).toThrow(
|
||||
'Domain not allowed',
|
||||
);
|
||||
expect(() =>
|
||||
axiosOptions.beforeRedirect!(redirectOptions, redirectResponseDetails),
|
||||
).toThrow('Domain not allowed');
|
||||
});
|
||||
|
||||
test.each([['example.com'], [undefined]])(
|
||||
|
|
@ -2260,7 +2264,7 @@ describe('Request Helper Functions', () => {
|
|||
|
||||
expect(axiosOptions.beforeRedirect).toBeDefined();
|
||||
expect(() =>
|
||||
axiosOptions.beforeRedirect!(redirectOptions, mock(), mock()),
|
||||
axiosOptions.beforeRedirect!(redirectOptions, redirectResponseDetails),
|
||||
).not.toThrow();
|
||||
},
|
||||
);
|
||||
|
|
@ -2280,9 +2284,9 @@ describe('Request Helper Functions', () => {
|
|||
};
|
||||
|
||||
expect(axiosConfig.beforeRedirect).toBeDefined();
|
||||
expect(() => axiosConfig.beforeRedirect!(redirectOptions, mock(), mock())).toThrow(
|
||||
'Domain not allowed',
|
||||
);
|
||||
expect(() =>
|
||||
axiosConfig.beforeRedirect!(redirectOptions, redirectResponseDetails),
|
||||
).toThrow('Domain not allowed');
|
||||
});
|
||||
|
||||
test.each([['example.com'], [undefined]])(
|
||||
|
|
@ -2301,7 +2305,7 @@ describe('Request Helper Functions', () => {
|
|||
|
||||
expect(axiosConfig.beforeRedirect).toBeDefined();
|
||||
expect(() =>
|
||||
axiosConfig.beforeRedirect!(redirectOptions, mock(), mock()),
|
||||
axiosConfig.beforeRedirect!(redirectOptions, redirectResponseDetails),
|
||||
).not.toThrow();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user