mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
feat(Azure Storage Node): New node (#12536)
This commit is contained in:
committed by
GitHub
parent
d550382a4a
commit
727f6f3c0e
@@ -10,8 +10,29 @@ export async function executeWorkflow(testData: WorkflowTestData, nodeTypes: INo
|
||||
if (testData.nock) {
|
||||
const { baseUrl, mocks } = testData.nock;
|
||||
const agent = nock(baseUrl);
|
||||
mocks.forEach(({ method, path, statusCode, requestBody, responseBody }) =>
|
||||
agent[method](path, requestBody).reply(statusCode, responseBody),
|
||||
mocks.forEach(
|
||||
({
|
||||
method,
|
||||
path,
|
||||
statusCode,
|
||||
requestBody,
|
||||
requestHeaders,
|
||||
responseBody,
|
||||
responseHeaders,
|
||||
}) => {
|
||||
let mock = agent[method](path, requestBody);
|
||||
|
||||
// nock interceptor reqheaders option is ignored, so we chain matchHeader()
|
||||
// agent[method](path, requestBody, { reqheaders: requestHeaders }).reply(statusCode, responseBody, responseHeaders)
|
||||
// https://github.com/nock/nock/issues/2545
|
||||
if (requestHeaders && Object.keys(requestHeaders).length > 0) {
|
||||
Object.entries(requestHeaders).forEach(([key, value]) => {
|
||||
mock = mock.matchHeader(key, value);
|
||||
});
|
||||
}
|
||||
|
||||
mock.reply(statusCode, responseBody, responseHeaders);
|
||||
},
|
||||
);
|
||||
}
|
||||
const executionMode = testData.trigger?.mode ?? 'manual';
|
||||
|
||||
Reference in New Issue
Block a user